Patch by Louis Strous:
authorJan Patera <patera@pictview.com>
Sat, 4 Oct 2008 11:22:29 +0000 (13:22 +0200)
committerJan Patera <patera@pictview.com>
Sat, 4 Oct 2008 11:22:29 +0000 (13:22 +0200)
DQT and DHT markers before APP1 marker were making libexif refusing images
and claiming there is no EXIF data present.
Both makers are now properly skipped.

libexif/exif-loader.c

index a33855aca203fd17c683f26e6235618255ca4f7f..f6e79d18031da4bcb3b2c9251d5536d219ba9bc4 100644 (file)
 #include <string.h>
 #include <stdio.h>
 
+#undef JPEG_MARKER_DHT
+#define JPEG_MARKER_DHT  0xc4
 #undef JPEG_MARKER_SOI
 #define JPEG_MARKER_SOI  0xd8
+#undef JPEG_MARKER_DQT
+#define JPEG_MARKER_DQT  0xdb
 #undef JPEG_MARKER_APP0
 #define JPEG_MARKER_APP0 0xe0
 #undef JPEG_MARKER_APP1
@@ -273,6 +277,8 @@ exif_loader_write (ExifLoader *eld, unsigned char *buf, unsigned int len)
                                eld->size = 0;
                                eld->state = EL_READ_SIZE_BYTE_08;
                                break;
+                       case JPEG_MARKER_DHT:
+                       case JPEG_MARKER_DQT:
                        case JPEG_MARKER_APP0:
                        case JPEG_MARKER_APP2:
                        case JPEG_MARKER_APP13: