Project

General

Profile

Bug #1056

Tiff file is not shown by Windows 8.1 viewer because of "Exif.Thumbnail.JPEGInterchangeFormatLength" field

Added by Danylo Kozub over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
metadata
Target version:
Start date:
15 Apr 2015
Due date:
% Done:

100%

Estimated time:

Description

I open original tiff (10.tiff), read metadata, then I clear metadata and write to new tiff:

Exiv2::Image::AutoPtr tempImage = Exiv2::ImageFactory::open(dest_path);
tempImage->clearMetadata();
tempImage->writeMetadata();

The strange thing is that resulting file (11.tif) contains "Exif.Thumbnail.JPEGInterchangeFormatLength"=0 field, which causes problems with Windows 8.1 viewer.

then I repeat saving again for the second tiff file, this field is gone!!

I cant find any logic to at least create some workaround for this problem, please help.


Files

10.tif (39.5 KB) 10.tif Danylo Kozub, 15 Apr 2015 08:47
11.tif (39.5 KB) 11.tif Danylo Kozub, 15 Apr 2015 08:47

Associated revisions

Revision 3711 (diff)
Added by Robin Mills over 4 years ago

#1056. Changed LangAltValueComparator to return bool str1 < str2 ? true : false. Test reference files updated to reflect alphabetic lang output.

History

#1

Updated by Danylo Kozub over 4 years ago

#2

Updated by Robin Mills over 4 years ago

  • Category set to metadata
  • Status changed from New to Assigned
  • Assignee set to Robin Mills
  • Target version set to 0.25

What a curious thing. My instant reaction is to say "Call Microsoft". However every puzzle is interesting, so here's what I've done:

526 rmills@rmillsmbp:~/Downloads/foo $ cp ../10.tif .
527 rmills@rmillsmbp:~/Downloads/foo $ cp ../11.tif .
528 rmills@rmillsmbp:~/Downloads/foo $ cp 10.tif 12.tif
529 rmills@rmillsmbp:~/Downloads/foo $ exiv2 -M"del Exif.Thumbnail.JPEGInterchangeFormatLength" 12.tif
530 rmills@rmillsmbp:~/Downloads/foo $ ls -alt
total 240
-rw-r--r--@  1 rmills  staff  40432 15 Apr 10:27 12.tif
drwxr-xr-x+  5 rmills  staff    170 15 Apr 10:27 .
-rw-r--r--@  1 rmills  staff  40462 15 Apr 10:27 11.tif
-rw-r--r--@  1 rmills  staff  40450 15 Apr 10:27 10.tif
drwx------+ 97 rmills  staff   3298 15 Apr 10:27 ..
531 rmills@rmillsmbp:~/Downloads/foo $ exiv2 -pa 10.tif > 10.txt 
10.tif: (No XMP data found in the file)
532 rmills@rmillsmbp:~/Downloads/foo $ exiv2 -pa 11.tif > 11.txt 
11.tif: (No XMP data found in the file)
533 rmills@rmillsmbp:~/Downloads/foo $ exiv2 -pa 12.tif > 12.txt 
12.tif: (No XMP data found in the file)
534 rmills@rmillsmbp:~/Downloads/foo $ diff 10.txt 11.txt
6c6,7
< Exif.Image.StripOffsets                      Long        5  250 8290 16330 24370 32410
---
> Exif.Image.StripOffsets                      Long        5  262 8302 16342 24382 32422
> Exif.Image.Orientation                       Short       1  top, left
535 rmills@rmillsmbp:~/Downloads/foo $ diff 10.txt 12.txt
6c6
< Exif.Image.StripOffsets                      Long        5  250 8290 16330 24370 32410
---
> Exif.Image.StripOffsets                      Long        5  232 8272 16312 24352 32392
14d13
< Exif.Thumbnail.JPEGInterchangeFormatLength   SLong       1  0
536 rmills@rmillsmbp:~/Downloads/foo $ 
I can see the Downloads/foo directory on the Windows7 Virtual Machine on my Mac. The Explorer icons look fine. File/Properties are fine. They all open OK in mspaint.exe

I've copied foo/*.tif to my Wife's Lenova slate running Windows 8.1. Again, I see nothing unusual. Images open in "Reader".

I don't see anything in the difference between 10.tif and 11.tif that has to do with Exif.Thumbnail.JPEGInterchangeFormatLength. If you want to provide more evidence, can I ask you to use exiv2.exe to modify files and then I can reproduce your workflow on my machine(s). Please provide the output of the command exiv2 -vV (verbose Version) so I know which version of exiv2 you are using.

#3

Updated by Danylo Kozub over 4 years ago

Thanks for your suggestions.

1. I've checked again on two 8.1 computers - 10.tif and 11.tif definitely have problems with Windows Viewer. Maybe this depends on Windows updates.

2. I confirm that exiv2 deletes Exif.Thumbnail.JPEGInterchangeFormatLength flag correctly.

3. I've checked exiv2 sources and the only difference with my code which I can see is that I am reading metadata from one tiff and writing it to another tiff file while exiv2 updates the same tiff file. So my question is if it is possible to transfer metadata from one file to another with single command?

#4

Updated by Robin Mills over 4 years ago

The sample application metacopy copies the metadata from one image to another.

$ make config
$ ./configure
$ make -j
$ sudo make install
$ make samples
bin/metacopy 10.tif 11.tif

If you're building with MSVC, the Solution will build into bin/$platform/$config/metacopy.exe
eg: <exiv2dir>/msvc2005/bin/x64/release/metacopy.exe

#5

Updated by Danylo Kozub over 4 years ago

I found the bug in my code :( Thanks and sorry for the troubles!

#6

Updated by Robin Mills over 4 years ago

  • Status changed from Assigned to Resolved

That's what we want: Happy Users.

I'm going to set the status to "Resolved" which means I don't plan to do further work on this issue. The status will be set to "Closed" during review when we ship v0.25.

#7

Updated by Robin Mills over 4 years ago

  • % Done changed from 0 to 100
#8

Updated by Andreas Huggel about 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF