This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: imghdr does not accept adobe photoshop mime type
Type: behavior Stage: resolved
Components: email Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: imghdr doesn't recognize variant jpeg formats
View: 16512
Assigned To: Nosy List: Claudiu.Popa, barry, benjamin.peterson, faiz, r.david.murray
Priority: normal Keywords:

Created on 2014-04-15 01:13 by faiz, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
image.jpeg faiz, 2014-04-15 01:13 Adobe Formatted image
Messages (5)
msg216260 - (view) Author: Faiz Abbasi (faiz) * Date: 2014-04-15 01:13
Python 2.7

I noticed a recurring bug we've had attempting to send a particular JPEG image in emails:

email.mime.image.__init__
<unknown>: Could not guess image MIME subtype

After looking into the imghdr.what and tests source code, I noticed that this JPEG image begins with the following data: 
'\xff\xd8\xff\xee\x00\x0eAdobe\x00d\x00\x00\x00\x00\x00\xff\xed\x008Photoshop '

I've attached the image in question to this bug report.

There's two functions for asserting an image is JPEG format, test_jpeg and test_exif. I'd like to propose another function for resolving Adobe Photoshop image formats.

Unless, of course, this is expected behavior?

Thanks!
msg216629 - (view) Author: Faiz Abbasi (faiz) * Date: 2014-04-17 00:27
Hey, just checking in on this?
msg216837 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-04-19 02:23
Well, it's 'expected' behavior in the sense that we don't know about 'adobe' format.  Is there some better way to detect jpeg format than to look for particular format identifiers in a specific byte position?
msg220366 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-06-12 16:41
Issue issue16512 has a patch which will recognize this format of JPEG, as well as others.
msg220406 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-06-13 01:02
Closing this in favor of issue 16512, which I will expand to include this case.
History
Date User Action Args
2022-04-11 14:58:01adminsetgithub: 65429
2014-06-13 01:02:26r.david.murraysetstatus: open -> closed
superseder: imghdr doesn't recognize variant jpeg formats
messages: + msg220406

resolution: duplicate
stage: resolved
2014-06-12 16:41:06Claudiu.Popasetnosy: + Claudiu.Popa
messages: + msg220366
2014-04-19 02:23:08r.david.murraysettype: enhancement -> behavior
messages: + msg216837
versions: + Python 3.4, Python 3.5
2014-04-17 00:27:40faizsetmessages: + msg216629
2014-04-15 01:13:51faizcreate