Error in the JFIF header in a jpeg file in version 6.7.9
Posted: 2012-10-12T07:36:53-07:00
I'm trying to convert a jpeg file using the option "-trim" before adding this file into a latex file.
However, since version 6.7.9, this produce an error. Imagemagick was build using macport on iMac on Mountain Lion.
I don't have this problem when using version 6.7.6 already installed on Mountain Lion.
When digging, it seems that the only difference between the two files produced after the command convert (one using version 6.7.9 and the other one using version 6.7.6) is in the JFIF header
hexdump -C c679.jpg |head -3
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 01 |......JFIF......|
00000010 00 01 00 00 ff db 00 43 00 01 01 01 01 01 01 01 |.......C........|
00000020 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 |................|
From the description en.wikipedia.org/wiki/JPEG_File_Interchange_Format:
• APP0 marker (2 bytes): ff e0
• Length (2 bytes): 00 10
• Identifier (5 bytes): 4a 46 49 46 00 = “JFIF” with zero following • Version (2 bytes): 01 01
• Density units (1 byte): 01 = Pixels per inch
• X density (2 bytes): 00 01 = 1 #NOT GOOD
• Y density (2 bytes): 00 01 = 1 #NOT GOOD • Thumbnail width (1 byte): 00
• Thumbnail height (1 byte): 00
hexdump -C c676.jpg |head -3
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 48 |......JFIF.....H|
00000010 00 48 00 00 ff db 00 43 00 01 01 01 01 01 01 01 |.H.....C........|
00000020 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 |................|
From the description en.wikipedia.org/wiki/JPEG_File_Interchange_Format: • APP0 marker (2 bytes): ff e0
• Length (2 bytes): 00 10
• Identifier (5 bytes): 4a 46 49 46 00 = “JFIF” with zero following
• Version (2 bytes): 01 01
• Density units (1 byte): 01 = Pixels per inch • X density (2 bytes): 00 48 = 72
• Y density (2 bytes): 00 48 = 72
• Thumbnail width (1 byte): 00
• Thumbnail height (1 byte): 00
I think the problem with the file c679.jpg is either the density units that should be 00 or the X and Y density that should be 00 48
I can attach the original and converted pictures if needed.
Vincent LIEGEOIS
However, since version 6.7.9, this produce an error. Imagemagick was build using macport on iMac on Mountain Lion.
I don't have this problem when using version 6.7.6 already installed on Mountain Lion.
When digging, it seems that the only difference between the two files produced after the command convert (one using version 6.7.9 and the other one using version 6.7.6) is in the JFIF header
hexdump -C c679.jpg |head -3
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 01 |......JFIF......|
00000010 00 01 00 00 ff db 00 43 00 01 01 01 01 01 01 01 |.......C........|
00000020 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 |................|
From the description en.wikipedia.org/wiki/JPEG_File_Interchange_Format:
• APP0 marker (2 bytes): ff e0
• Length (2 bytes): 00 10
• Identifier (5 bytes): 4a 46 49 46 00 = “JFIF” with zero following • Version (2 bytes): 01 01
• Density units (1 byte): 01 = Pixels per inch
• X density (2 bytes): 00 01 = 1 #NOT GOOD
• Y density (2 bytes): 00 01 = 1 #NOT GOOD • Thumbnail width (1 byte): 00
• Thumbnail height (1 byte): 00
hexdump -C c676.jpg |head -3
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 48 |......JFIF.....H|
00000010 00 48 00 00 ff db 00 43 00 01 01 01 01 01 01 01 |.H.....C........|
00000020 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 |................|
From the description en.wikipedia.org/wiki/JPEG_File_Interchange_Format: • APP0 marker (2 bytes): ff e0
• Length (2 bytes): 00 10
• Identifier (5 bytes): 4a 46 49 46 00 = “JFIF” with zero following
• Version (2 bytes): 01 01
• Density units (1 byte): 01 = Pixels per inch • X density (2 bytes): 00 48 = 72
• Y density (2 bytes): 00 48 = 72
• Thumbnail width (1 byte): 00
• Thumbnail height (1 byte): 00
I think the problem with the file c679.jpg is either the density units that should be 00 or the X and Y density that should be 00 48
I can attach the original and converted pictures if needed.
Vincent LIEGEOIS