-
Notifications
You must be signed in to change notification settings - Fork 15
Support raw images #16
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
Comments
This is actually more difficult than I thought, there seem to be a phletora of different formats and reading any of them directly requires knowing width and height of the image in advance. Possibly simply reading the embedded jpeg is a solution as mention in the issue linked before, but I can only find the small thumbnail version of this which is rather small for displaying. @tobiasbrummer or @ninrod, could you comment on what you mean with the embedded jpeg, is it really simply the thumbnail? |
I don’t know about all cameras as I only have access to my Sony A6300 at the moment. But I just tried to extract the embedded JPG image from a RAW file of the Sony A6300 with „dcraw -e“ and I get a JPG file with ~1600x1080px which I think is enough for preview purposes. |
Thanks, that was the hint I needed 😄 With a quick and dirty hack I can get this working. For future reference, something along the lines of
There are more pythonic solutions, e.g. using wand, but these seem significantly slower as they actually process the complete raw file. As, in any case, this adds an additional dependency I think this could be a great plugin after #13 is in. Writing the actual API is currently my focus, a raw plugin could then be the next step. |
This plugin makese it easy to add new image formats without impacting the performance of `utils.files.is_image` by adding very many formats by default. The plugin can be activated by adding `imageformats = name, ...` to the plugins section of the configuration file. As a proof of concept, the "cr2" format is added here. To extend support for additional formats, we now only have to: * Implement a imghdr like test function in imageformats. * Add that function with the corresponding format name to the FORMATS dictionary. * Activate it in the configuration file as described above. This is related to supporting raw images (#16) as this is in principle possible with qt raw, but we don't recognize the images in the correct format as they are not part of imghdr.
I have recently learned about qt raw plugin. In principle this would provide full support for raw images. Issue with this is that the check we use to determine if a file is an image ( In principle, it is not too difficult to extend It would be great if we could extend |
Solved via @jcjgraf's RawPrev plugin and, in principle, with qt raw. I don't think there is more we can or should do here. |
There has been the request for supporting raw images, this should be rather simple according to
https://stackoverflow.com/questions/18637721/how-to-display-a-raw-image-file-in-a-qt-gui.
The file format would have to be detected by the load method in
imutils/imfile_handler.py
and a correct pixmap created from the data.See this issue of the GTK version.
The text was updated successfully, but these errors were encountered: