Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RGBA convert to CMYK lost dpi and other info #1676

Closed
zhanglc opened this issue Jan 22, 2016 · 11 comments
Closed

RGBA convert to CMYK lost dpi and other info #1676

zhanglc opened this issue Jan 22, 2016 · 11 comments
Labels
Bug Any unexpected behavior, until confirmed feature.

Comments

@zhanglc
Copy link

zhanglc commented Jan 22, 2016

im = Image.open('1.jpg')
im.info
{'jfif': 257, 'jfif_unit': 1, 'exif': 'Exif\x00\x00MM\x00_\x00\x00\x00\x08\x00\x0c\x01\x00\x00\x03\x00\x00\x00\x01\x03A\x00\x00\x01\x01\x00\x03\x00\x00\x00\x01\x01\xc1\x00\x00\x01\x02\x00\x03\x00\x00\x00\x03\x00\x00\x00\x9e\x01\x06\x00\x03\x00\x00\x00\x01\x00\x02\x00\x00\x01\x12\x00\x03\x00\x00\x00\x01\x00\x01\x00\x00\x01\x15\x00\x03\x00\x00\x00\x01\x00\x03\x00\x00\x01\x1a\x00\x05\x00\x00\x00\x01\x00\x00\x00\xa4\x01\x1b\x00\x05\x00\x00\x00\x01\x00\x00\x00\xac\x01(\x00\x03\x00\x00\x00\x01\x00\x02\x00\x00\x011\x00\x02\x00\x00\x00\x1d\x00\x00\x00\xb4\x012\x00\x02\x00\x00\x00\x14\x00\x00\x00\xd1\x87i\x00\x04\x00\x00\x00\x01\x00\x00\x00\xe8\x00\x00\x01 \x00\x08\x00\x08\x00\x08\x00\x00\x00\x96\x00\x00\x00\x01\x00\x00\x00\x96\x00\x00\x00\x01Adobe Photoshop CC (Windows)\x002016:01:18 10:25:46\x00\x00\x00\x00\x00\x04\x90\x00\x00\x07\x00\x00\x00\x040221\xa0\x01\x00\x03\x00\x00\x00\x01\xff\xff\x00\x00\xa0\x02\x00\x04\x00\x00\x00\x01\x00\x00\x03A\xa0\x03\x00\x04\x00\x00\x00\x01\x00\x00\x01\xc1\x00\x00\x00\x00\x00\x00\x00\x06\x01\x03\x00\x03\x00\x00\x00\x01\x00\x06\x00\x00\x01\x1a\x00\x05\x00\x00\x00\x01\x00\x00\x01n\x01\x1b\x00\x05\x00\x00\x00\x01\x00\x00\x01v\x01(\x00\x03\x00\x00\x00\x01\x00\x02\x00\x00\x02\x01\x00\x04\x00\x00\x00\x01\x00\x00\x01~\x02\x02\x00\x04\x00\x00\x00\x01\x00\x00\x10H\x00\x00\x00\x00\x00\x00\x00\x96\x00\x00\x00\x01\x00\x00\x00\x96\x00\x00\x00\x01\xff\xd8\xff\xed\x00\x0cAdobe_CM\x00\x02\xff\xee\x00\x0eAdobe\x00d\x80\x00\x00\x00\x01\xff\xdb\x00\x84\x00\x0c\x08\x08\x08\t\x08\x0c\t\t\x0c\x11\x0b\n\x0b\x11\x15\x0f\x0c\x0c\x0f\x15\x18\x13\x13\x15\x13\x13\x18\x11\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x01\r\x0b\x0b\r\x0e\r\x10\x0e\x0e\x10\x14\x0e\x0e\x0e\x14\x14\x0e\x0e\x0e\x0e\x14\x11\x0c\x0c\x0c\x0c\x0c\x11\x11\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\xff\xc0\x00\x11\x08\x00V\x00\xa0\x03\x01"\x00\x02\x11\x01\x03\x11\x01\xff\xdd\x00\x04\x00\n\xff\xc4\x01?\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x01\x02\x04\x05\x06\x07\x08\t\n\x0b\x01\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x10\x00\x01\x04\x01\x03\x02\x04\x02\x05\x07\x06\x08\x05\x03\x0c3\x01\x00\x02\x11\x03\x04!\x121\x05AQa\x13"q\x812\x06\x14\x91\xa1\xb1B#$\x15R\xc1b34r\x82\xd1C\x07%\x92S\xf0\xe1\xf1cs5\x16\xa2\xb2\x83&D\x93TdE\xc2\xa3t6\x17\xd2U\xe2e\xf2\xb3\x84\xc3\xd3u\xe3\xf3F\'\x94\xa4\x85\xb4\x95\xc4\xd4\xe4\xf4\xa5\xb5\xc5\xd5\xe5\xf5Vfv\x86\x96\xa6\xb6\xc6\xd6\xe6\xf67GWgw\x87\x97\xa7\xb7\xc7\xd7\xe7\xf7\x11\x00\x02\x02\x01\x02\x04\x04\x03\x04\x05\x06\x07\x07\x06\x055\x01\x00\x02\x11\x03!1\x12\x04AQaq"\x13\x052\x81\x91\x14\xa1\xb1B#\xc1R\xd1\xf03$b\xe1r\x82\x92CS\x15cs4\xf1%\x06\x16\xa2\xb2\x83\x07&5\xc2\xd2D\x93T\xa3\x17dEU6te\xe2\xf2\xb3\x84\xc3\xd3u\xe3\xf3F\x94\xa4\x85\xb4\x95\xc4\xd4\xe4\xf4\xa5\xb5\xc5\xd5\xe5\xf5Vfv\x86\x96\xa6\xb6\xc6\xd6\xe6\xf6\'7GWgw\x87\x97\xa7\xb7\xc7\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00?\x00\xe7\x12I\x1f\x03\x14\xe6\xe7ca\x87l96\xb2\x90\xf2\'n\xf3\xb7~\xd9n\xed\xab=\xec\x89\x00\x12v\x02\xca\x04\x96\xf6\x1f\xd5\x9a\xb2\xebu\xd5d\xde\xfa\xbe\xca\xdc\xba\xcb1\x9b$\x17\x9a\r/e\x99m\xfd6\xe6?\xd8\xcb6>\xbf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\x1f\xf1\x7f\xeeT\x910$\xf6I"$\x11\xe3\xa2\x0b\xdb\xae\xe8\xddU\xac\xf5\x1d\x8c\xe6\xb3\xd1vPq-\x83K6\xef\xb8{\xbe\x8b}F_\xae\xaa\xe6\xee.\xad\xed\r :X\xe1\x04\xfd\x10\xe9o\xb7r\xbaz\xdeQf\xc0\xc6\x80Z\xd6:]k\x83\xab\x10\x1dC\x9be\xaeo\xa5n\xdf\x7f\xfd\x04W}e\xea\xaex\xb3\xd4sHn\xdd,\xb7X>\xd3\xb8\xd9\xbf\xdb\xefo\xfdq;F\x11,\xddc\x13\xf5\xe1\xff\x00\xbfr\xbe:\x1f\x03\xa2\x93>\x9b\x7f\xac?*\x9eNE\x99Y\x16d\xd9\xfc\xe5\xce\xdc\xedK\xb5\xfe\xbd\x85\xd6;\xfbnPg\xd3o\xf5\x87\xe5A\x97Z\xd7M\x1f\xff\xd4\xe7\x12\jK9\xec\x9e\xc9%\xc6\xa4\x92\x9e\xc9%\xc6\xa4\x92\x9e\xc9%\xc6\xa4\x92\x9e\xc9%\xc6\xa4\x92\x9e\xc9%\xc6\xa4\x92\x9e\xc9%\xc6\xa4\x92\x9e\xc9%\xc6\xa4\x92\x9e\xc9%\xc6\xa4\x92\x9e\xc9I\x9fM\xbf\xd6\x1f\x95qi$\xa7\xff\xd9', 'jfif_version': (1, 1), 'jfif_density': (150, 150), 'dpi': (150, 150)}

convert 1.jpg to CMYK

im.convert('CMYK').save('2.jpg',dpi=(150,150))

then

im = Image.open('3.jpg')

 im.info

{'adobe': 100, 'adobe_transform': 100}
@radarhere
Copy link
Member

I can tell you that when the file is being re-read, it looks like the APP0 (JFIF and DPI) and APP1 (EXIF) markers are missing, and the APP14 (Adobe) marker is being read instead.

convert Tests/images/hopper.jpg -colorspace CMYK test.jpg preserves the DPI and JFIF data without a problem, so I can confirm that this is a bug with Pillow.

@radarhere radarhere added the Bug Any unexpected behavior, until confirmed feature. label Jan 23, 2016
@zhanglc
Copy link
Author

zhanglc commented Jan 23, 2016

any idea for temporary fix?

@radarhere
Copy link
Member

If your use case allows it, the ImageMagick command I mentioned above could serve you well. Otherwise, I doubt that there will be a temporary fix before the actual fix.

@zhanglc
Copy link
Author

zhanglc commented Jan 23, 2016

im.convert('CMYK').info

{'jfif': 258, 'jfif_unit': 1, 'adobe': 100, 'jfif_version': (1, 2), 'jfif_density': (350, 350), 'dpi': (350, 350), 'adobe_transform': 100}

but when save ,the info lost ,does it mean that ,the save method has a issue ?

@radarhere
Copy link
Member

Yes, that is my current assessment.

@wiredfool
Copy link
Member

Is the metadata preserved if opening and saving as a plain RGB jpeg?

@radarhere
Copy link
Member

radarhere commented Jan 24, 2016

from PIL import Image
im = Image.open('Tests/images/pil_sample_rgb.jpg')
im.info.keys()
>>> dict_keys(['exif', 'adobe', 'dpi', 'jfif', 'adobe_transform', 'icc_profile', 'jfif_unit', 'jfif_version', 'jfif_density'])

im.save('test.jpg')
Image.open('test.jpg').info.keys()
>>> dict_keys(['jfif_density', 'jfif_version', 'jfif', 'jfif_unit'])

im.save('test.jpg',dpi=im.info['dpi'])
Image.open('test.jpg').info.keys()
>>> dict_keys(['dpi', 'jfif_density', 'jfif_version', 'jfif', 'jfif_unit'])

im.save('test.jpg',exif=im.info['exif'])
Image.open('test.jpg').info.keys()
>>> dict_keys(['exif', 'jfif_density', 'jfif_version', 'jfif', 'jfif_unit'])

im.save('test.jpg',dpi=im.info['dpi'],exif=im.info['exif'])
Image.open('test.jpg').info.keys()
>>> dict_keys(['exif', 'dpi', 'jfif', 'jfif_unit', 'jfif_version', 'jfif_density'])

@wiredfool
Copy link
Member

So, it's not CMYK, it's the jpeg encoder.

@dawncold
Copy link

dawncold commented Jul 7, 2017

yes, it's jpeg encoder. I added resolution info via exiftool -xresolution=300 -yresolution=300 xxx.jpg

@radarhere radarhere changed the title RGBA Convert to CMYK lost dpi and other info RGBA convert to CMYK lost dpi and other info Sep 12, 2018
@radarhere
Copy link
Member

PR #4639 has a fix to resolve this. If that PR is merged in, then it's just a matter of using the dpi and exif arguments when saving, and this should be fixed.

from PIL import Image
im = Image.open("in.jpg")
im.save("out.jpg", dpi=im.info['dpi'], exif=im.info['exif'])

@hugovk
Copy link
Member

hugovk commented Jun 20, 2020

Fixed by #4639. Nice to squash a 4.5 year old bug!

@hugovk hugovk closed this as completed Jun 20, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Any unexpected behavior, until confirmed feature.
Projects
None yet
Development

No branches or pull requests

5 participants