-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Add pictures to dive feature issue - EXIF data not read correctly #370
Comments
Thanks @sfuchs79 -- @atdotde has worked on the EXIF handling in the past... I remember that there were different fields to chose from - but since the one that we are choosing currently clearly contains a timestamp of 0, maybe in that case looking at one of the other fields is the better approach. Robert, given the files that Stefan posted, is that something you could look at? Thanks |
Function where the error occurs is picture_get_timestamp. For some reason exif.parseFrom returns an error. The returned error code is: // No JPEG markers found in buffer, possibly invalid JPEG file And when looking into the not ok images, they are indeed missing proper JPEG magic. And indeed, they are in fact TIFF images, not JPEGS. Incorrect file extension... |
You're most probably right in a way that the "nok" files don't have a propper JPEG header. I neither have the expertise nor the right tools at the moment to check this. Now comes the more interesting part: Finally I believe that being able to read Exif from any file that can have Exif data and that we support from image format point of view should be our goal and that this may be not too difficult. |
My initial analysis was incorrect - too tired at the time. Anyway, do you import the sample images properly when you disable the exif sanity check? If you use 'file' command in Linux, that reports information about the files by analyzing the magic headers. It does mention both JPEG and TIFF for the image data for all files, however. You can check the start of the file in hex e.g. using the following one-liner: $ for i in .jpg; do echo $i; xxd $i | head -n 2; done But the problem is actually at the end of the file. There is some additional data after the JPEG end marker. And that is the reason our Exif library claims improper data... |
Yes, for my "nok" JPG everything works ok if I disable the sanity check. With one quick check I also think that we can't handle TIFF images at all. Neither read the Exif data nor process the image correctly. I have these suggestions and would prapare a PR for this but would like to hear some comments first:
|
Just a quick comment: Except for the exif data analysis, we don't handle images at all. All the lifting is performed by Qt. We can open whatever Qt recognises as an image. And that can be platform dependent (or even be enhanced by plugins), all details are on http://doc.qt.io/qt-5/qimage.html#reading-and-writing-image-files The correct way to assemble the file filter is to use QImageReader::supportedImageFormats() as we already do in qthelper.cpp. So you can probably simply cut&paste code from there or even better factor out a function that returns an appropriate file filter. |
The exif handling we got from another project. You might want to contact the author of that project if you think there's something wrong with handling those images. |
Good point. When doing this I found this: I'm also going to ask about TIFFs... :-) |
Closed via #384 |
When trying the picture feature the first time I immediately found a couple of pictures where the EXIF date/time seems to be not evaluated corretly when importing the pictures to a dive. Three examples here with screen shots and files...
Windows explorer:
Subsurface:
Files:
Pictures.zip
To be very open I didn't look at the pictures with any specific EXIF info viewer up to now. So maybe the EXIF info is really incorrect or corrupted. But Windows explorer shows it correctly.
The text was updated successfully, but these errors were encountered: