Skip to content

Truevision TGA open error ("struct.error: unpack requires a bytes object of length 4") #1550

Description

@filonik

Attempting to open a TGA image (any image will do, e.g. one of those [1]) in Pillow 3.0.0 results in the following error:

[ERROR] PIL.ImageFile: %s
Traceback (most recent call last):
  File "c:\Python34\lib\site-packages\PIL\ImageFile.py", line 100, in __init__
    self._open()
  File "c:\Python34\lib\site-packages\PIL\CurImagePlugin.py", line 71, in _open
    self._bitmap(i32(m[12:]) + offset)
  File "c:\Python34\lib\site-packages\PIL\_binary.py", line 49, in i32le
    return unpack("<I", c[o:o+4])[0]
struct.error: unpack requires a bytes object of length 4

[1] http://www.quake3world.com/forum/viewtopic.php?t=9242

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions