Thanks for the quick reply. I have done some more testing with exiftool, and it seems that while it can read the exif on the converted file, it can't write to it:
Code: Select all
exiftool -v3 -a -n -EXIF:ExposureProgram=3 -o "-testRewriteExif.jpg" "-test.jpg" > "-testRewriteExif.jpgExiftool"
Outputs
Writing ExifIFD:ExposureProgram
======== /home/brighto/public_html/photosite/CSI/Img/-test.jpg
'/home/brighto/public_html/photosite/CSI/Img/-test.jpg' --> '/home/brighto/public_html/photosite/CSI/Img/-testRewriteExif.jpg'
Rewriting /home/brighto/public_html/photosite/CSI/Img/-test.jpg...
Editing tags in: APP0 APP1 ExifIFD IFD0 JFIF
Creating tags in: APP1 ExifIFD IFD0
JPEG APP0 (14 bytes):
0000: 4a 46 49 46 00 01 01 01 01 2c 01 2c 00 00 [JFIF.....,.,..]
Rewriting JFIF
JPEG APP13 (2674 bytes):
0000: 50 68 6f 74 6f 73 68 6f 70 20 33 2e 30 00 38 42 [Photoshop 3.0.8B]
0010: 49 4d 04 04 00 00 00 00 01 73 1c 02 00 00 02 00 [IM.......s......]
0020: 02 1c 02 78 00 6b 53 74 20 4d 61 72 79 27 73 20 [...x.kSt Mary's ]
0030: 50 61 72 69 73 68 20 43 68 75 72 63 68 20 69 6e [Parish Church in]
0040: 20 74 68 65 20 76 69 6c 6c 61 67 65 20 6f 66 20 [ the village of ]
0050: 42 69 74 74 65 73 77 65 6c 6c 2c 20 4c 65 69 63 [Bitteswell, Leic]
0060: 65 73 74 65 72 73 68 69 72 65 2c 20 55 4b 20 6f [estershire, UK o]
[snip 2562 bytes]
JPEG APP1 (2280 bytes):
0000: 45 78 69 66 00 00 49 49 2a 00 08 00 00 00 12 00 [Exif..II*.......]
0010: 0e 01 02 00 6c 00 00 00 e6 00 00 00 0f 01 02 00 [....l...........]
0020: 12 00 00 00 52 01 00 00 10 01 02 00 0b 00 00 00 [....R...........]
0030: 64 01 00 00 12 01 03 00 01 00 00 00 01 00 00 00 [d...............]
0040: 01 00 00 00 01 00 00 00 6f 01 00 00 1b 01 05 00 [........o.......]
0050: 01 00 00 00 77 01 00 00 28 01 03 00 01 00 00 00 [....w...(.......]
0060: 02 00 00 00 31 01 02 00 1c 00 00 00 7f 01 00 00 [....1...........]
[snip 2168 bytes]
Rewriting IFD0
ExifByteOrder = II
Warning = [minor] Entries in IFD0 were out of sequence. Fixed.
Error = Bad format (0) for IFD0 entry 0
0 image files updated
1 files weren't updated due to errors
Whereas doing the same command on the original file updates it okay without errors.
Exiftool verbose dumps:
-test.jpgExiftoolDump (converted file) XMPTest.jpgExiftoolDump
This may not be important, but I also found that if when doing a verbose level 3 dump with exiftool
Code: Select all
exiftool -v3 "-test.jpg" > "-test.jpgExiftoolDump"
exiftool -v3 "XMPTest.jpg" > "XMPTest.jpgExiftoolDump"
What I guess is the start of the XMP Packet looks like this in XMPTest (the original file):
JPEG APP1 (9886 bytes):
137a: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [
http://ns.adobe.]
138a: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
139a: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 22 ef bb [packet begin="..]
13aa: bf 22 20 69 64 3d 22 57 35 4d 30 4d 70 43 65 68 [." id="W5M0MpCeh]
13ba: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 22 [iHzreSzNTczkc9d"]
13ca: 3f 3e 20 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?> <x:xmpmeta xm]
13da: 6c 6e 73 3a 78 3d 22 61 64 6f 62 65 3a 6e 73 3a [lns:x="adobe:ns:]
but in the converted file (-test), it looks like this (note the space before the .<?xpacket):
JPEG APP1 (9887 bytes):
1578: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [
http://ns.adobe.]
1588: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 20 00 3c 3f [com/xap/1.0/ .<?]
1598: 78 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 22 ef [xpacket begin=".]
15a8: bb bf 22 20 69 64 3d 22 57 35 4d 30 4d 70 43 65 [.." id="W5M0MpCe]
15b8: 68 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 [hiHzreSzNTczkc9d]
15c8: 22 3f 3e 20 3c 78 3a 78 6d 70 6d 65 74 61 20 78 ["?> <x:xmpmeta x]
15d8: 6d 6c 6e 73 3a 78 3d 22 61 64 6f 62 65 3a 6e 73 [mlns:x="adobe:ns]
If I write an XMP tag using exiftool on the converted file, then do a verbose level 3 dump on the file using exiftool, I see it has 2 xmp sections, it looks like exiftool has written a new xmp block to the file, and the xmp tag written can be read by the Firefox exif plugin. The new xmp block looks like this (note no space before the .<xpacket):
JPEG APP1 (2844 bytes):
137a: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [
http://ns.adobe.]
138a: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
139a: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 27 ef bb [packet begin='..]
13aa: bf 27 20 69 64 3d 27 57 35 4d 30 4d 70 43 65 68 [.' id='W5M0MpCeh]
13ba: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 27 [iHzreSzNTczkc9d']
13ca: 3f 3e 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?>.<x:xmpmeta xm]
13da: 6c 6e 73 3a 78 3d 27 61 64 6f 62 65 3a 6e 73 3a [lns:x='adobe:ns:]
[snip 2732 bytes]
+ [XMP directory, 2815 bytes]
| XMPToolkit = Image::ExifTool 7.79
| Source = Dave Kennard
| - Tag 'x:xmpmeta/rdf:RDF/rdf:Description/photoshop:Source'
The xmp section that Image Magick wrote (with the space before the .<xpacket) when creating the file is still there, but the Firefox exif plugin still can't read it, only the new XMP tag written by exiftool.
Here's the dump for the file converted by Image Magick then an XMP tag written by exiftool: -
testRewriteXMP.jpgExiftoolDump
Dave