-
Notifications
You must be signed in to change notification settings - Fork 282
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
some [Canon] & [Composite] tags get lost or modified #1589
Comments
Just an FYI: ExifTool's "Composite" tags are derived/calculated from data, and not actually in the file, so not really relevant for the issue here. |
Oh ok, I didin't know that, thanks. So problem is with the Canon tags then. |
It seems that exiv2 doesn't correctly handle the specific makernote in these files... Sorry that I can't be more helpful yet. |
@tenzap are the images you linked straight out of the camera or were they previously modified by some tool? |
I don't know if they have been modified. They have been contributed in that repo by See readme in https://github.com/ianare/exif-samples/tree/master/jpg/hdr |
Ok, so the good news are that I think I know the reason for the problem: The offsets of the makernote IFDs are incorrect. There is some documentation about this in the exiftool doc. (search for Now that we know this we can come up with a workaround, by simply using To not actually change the content we do the following:
$ exiftool -F -exif:resolutionunit=inches tmp.jpg Now you can run But the bad news: I don't know whether there is going to be an @clanmills are you aware of similar problems in the past? Is this something that is common enough for us to make this urgent? Maybe we will just leave this open and try to come up with a solution when the canon makernote gets modernized? |
The differences in the metadata between canon_hdr_NO.jpg and canon_hdr_YES.jpg are considerable. Changes have been made in I haven't studied the claim that deleting the thumbnail causes collateral metadata damage. A solid issue here is that ExifTool reports If darktable wants Exiv2 to calculate We're discussing about four different matters here, so the signal-to-noise ratio isn't good. We need an original camera file which is edited in a simple manner such as:
I recommend that |
Thanks @clanmills for the comments 👍 @tenzap, for now at least, the problem of "fixing files on the fly" is out of scope for exiv2. Please feel free to reopen the issue if you'd like to further discuss this 😊 |
I'm not sure I understand everything very well. I understand that you claim that the metadata has been modified by another tool which didn't update the IFD correctly resulting in exiv2 not being able to understand them. Again I don't know what happened to these test files (the provider of the files didn't answer to my email unfortunately). If input is bad, I can understand that exiv2 may not want to fix them like exiftool does. I believe canon_hdr_NO.jpg and canon_hdr_YES.jpg are two different pictures, they are not related in sense of one being a derivative of the other in terms of exif metadata. Concerning composite, it is not that I want it particularly, it was just to show all the differences I get when making a diff, I didn't mean in anyway that it is a bug in exiv2. I event didn't know Composite was actually a "computed" tag by exiftool. My report was mainly to show that it seems some tags are lost in the process of deleting a thumbnail (and probably any other operation on the exif metadata), I don't have the knowledge to understand/dig more. Thanks for having had a look at all this |
When I went for a walk today, I started to thing about this bug and thought I'll investigate using -dt on an image from my Canon IXUS 185 Point and Shoot". I'm pleased to say that:
Your test images:
My photo:
Extract the metadata, delete the thumbnail and extract again:
Display the changes in the metadata:
For sure there is no collateral damage the metadata. The primary difference is of course the removal of the Exif.Thumbnail.* tags. There minor changes to the MakerNote, InteroperabilityTag and surprisingly GPSTag. I could dig in with the debugger and explain the changes byte-by-byte, however I don't believe that's necessary. I have a feeling that you are relaying this issue from elsewhere. Somebody has said "There's something wrong with the metadata in canon_hdr_YES.jpg or canon_hdr_NO.jpg" The relationship between the two files isn't explained. I encourage you to invite the person who raised this issue to read this analysis provide more information. I've discussed this on the Exiv2 Chatserver with @hassec. We agree that making progress with this issue isn't possible because it has not been presented with sufficient clarity. Of course, that doesn't mean that Exiv2 is innocent. I've now retired from Exiv2. If you have additional information about this matter, please update the issue. I am willing to help debug/analyse this issue when more evidence is available. |
These files are provided by this repo. I used them to test my code in this app which uses exiv2 to add thumbnails. I noticed the differences I filed in this bug report and found that the issue was not in my code but linked to exiv2 and narrowed it down to show there is some issue somewhere when deleting a thumbnail (inserting also leads to the same diff, but the deletion command was easier to provide a test case rather than inserting it or changing any tag) I created an issue in the repo to get more info on these files (if they have been transformed or if they are original). My understanding is these are 2 different shots with the same camera, one with HDR enabled, and one with HDR disabled. As you say, it would be much better if we had the original picture if this one is indeed transformed. Hopefully we will have an update on this to be sure where the problem actually lies. BTW, there are other canon files in that repo for which there is no problem. Only these two picture show that bug. |
I tried with two pictures I found on the internet and which are said to be original.
Removal of thumbnails by exiv2 showed nothing wrong. This tends to confirm that canon_hdr_YES.jpg & canon_hdr_NO.jpg are not the original & what @hassec said:
I asked again the original contributor of the canon_hdr_YES.jpg & canon_hdr_NO.jpg if by chance he could provide the original pictures. Let's see. |
Thank for following through on this. I'll self-assign and reopen the issue. Let's not use the word bug until we have a solid case that exiv2 is behaving incorrectly. |
I'm also assigning this to milestone v1.00. In the release notes, I list issues which are "Withdrawn/No Action". |
@tenzap I'm impressed to see you have an application to add thumbnail to images. That capability has never been implemented in Exiv2. Could you think about joining Team Exiv2 and porting your code into the library. I've retired from Exiv2, so I'm not offering to mentor or support you. However I've retired after 13 years of working on the code in the knowledge that there is group of friendly, clever engineers contributing to Exiv2 and I know you'll enjoy working with them. |
It is possible to add thumbnails with exiv2 with -it option, I simply reused what is already in exiv2. Thank you for your proposal, but sorry I don't plan to join the team, I'm more sort of a hobby developer. Thanks for the great exiv2 tool/lib |
I just added some code to add the mandatory exif tags in case there is no exif metadata at all in the file. You may find it here |
I'm making up the release notes for v0.27.4. I'm going to assign this to v0.27.4 and close it. If/when more information concerning this is available, please open a new issue. |
With linked canon pictures, some [Canon] & [Composite] tags get lost or modified when for example deleting thumbnail when running:
exiv2 -dt pic.jpg
Same problem when inserting thumbnail, and maybe whichever operation we do.
This is with 0.27.4 RC2
Sample pictures:
Report of diff using "exiftool -a -G1 pic.jpg" for one of the pictures above, the other picture has a different diff result
The text was updated successfully, but these errors were encountered: