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
.arw files not supported? #3124
Comments
Pillow does not currently support ARW. See the list of supported formats - http://pillow.readthedocs.io/en/5.1.x/handbook/image-file-formats.html If you would like to create a PR to add support - http://pillow.readthedocs.io/en/5.1.x/handbook/writing-your-own-file-decoder.html - that would be considered, but unfortunately, the maintainers of Pillow do not have an abundance of time when it comes to adding new functionality. |
It is interesting that Pillow does NOT identify them as TIFF. They do contain a lot of standard tags including the date, image size and resolution. EXIF data is in the file but not a TIFF standard and of course the standard TIFF image formats are not used. Lots of RAW files seem to use the approach so a generic RAW plugin could be of use. Is there an existing plugin that could be used as a model? |
If you're asking where Pillow processes TIFF images, it is at https://github.com/python-pillow/Pillow/blob/main/src/PIL/TiffImagePlugin.py If you're wondering how the user gets to EXIF data in there, Line 1415 in 601324b
retrieves Pillow/src/PIL/TiffImagePlugin.py Lines 1066 to 1072 in 601324b
Do you have an ARW file that you could attach here? Ideally, one that could be added to Pillow's test suite and distributed under Pillow license. |
Dear Andrew
Tried to send you a sample arw file last week but it was too big so put it on github johns1c/sony_raw. Feel free to copy it if you wish.
The TIFF plugin's accept function only checks the first few bytes of the file and may "TIFF like" raw files will match this. It then fails when trying to obtain the ImageWidth tag which is NOT present in the first IFD and the error pops up as an unrecognised file error.
Baseline TIFF vs "TIFF like'
There seem to be some Japanese Electronic Industry standards that recommend that digital still cameras use sub-IFDs which differs from TIFF 6 baseline tag usage (but the baseline only covers certain image/compression types which we do not have here). This does seem to fit with the bit in the TIFF 6 spec which says that rather than registering lots of new tags other parties should use sub-IFDs.
Many Thanks,
Chris
|
The width and height are not the only problems. If I temporarily hardcode in the width and height of the image to work around the need for ImageWidth and ImageHeight, TiffImagePlugin then raises "SyntaxError: unknown pixel mode" on |
Closing as part of #6482 |
What did you do?
I have been using the library to get the image creation date and everything was working perfect until I switched from .jpg to .arw format (my sony alpha camera saves the raw files with this format).
What did you expect to happen?
Get my exif tag as always.
What actually happened?
The python script could not open the image. However, when inspecting the file with other apps there are no problems getting exif data.
What versions of Pillow and Python are you using?
Python 3.6.5
Pillow 5.1.0
Code:
Error:
The text was updated successfully, but these errors were encountered: