Skip to content

icc_profile #1778

Description

@radarhere
from PIL import Image
Image.open('Pillow/Tests/images/hopper.iccprofile.tif').save('test.png')

In Python 3.5, this results in

Traceback (most recent call last):
  Line 2, in <module>
    Image.open('Pillow/Tests/images/hopper.iccprofile.tif').save('test.png')
  File "PIL/Image.py", line 1675, in save
    save_handler(self, fp, filename)
  File "PIL/PngImagePlugin.py", line 757, in _save
    data = name + b"\0\0" + zlib.compress(im.info["icc_profile"])
TypeError: a bytes-like object is required, not 'tuple'

In Python 3.3 and 3.4, it's TypeError: 'tuple' does not support the buffer interface. In Python 2.7, it's TypeError: must be string or read-only buffer, not tuple

im.info["icc_profile"] is a tuple of length 1, where the first argument is a bytes-like object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugAny unexpected behavior, until confirmed feature.TIFF

    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