diff options
-rw-r--r-- | source/cbz/mucbz.c | 4 | ||||
-rw-r--r-- | source/fitz/image.c | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c index 309acd71..91918f57 100644 --- a/source/cbz/mucbz.c +++ b/source/cbz/mucbz.c @@ -6,8 +6,8 @@ typedef struct cbz_document_s cbz_document; typedef struct cbz_page_s cbz_page; static const char *cbz_ext_list[] = { - ".jpg", ".jpeg", ".png", ".gif", ".bmp", - ".JPG", ".JPEG", ".PNG", ".GIF", ".BMP", + ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif", ".tiff", + ".JPG", ".JPEG", ".PNG", ".GIF", ".BMP", ".TIF", ".TIFF", NULL }; diff --git a/source/fitz/image.c b/source/fitz/image.c index a027b902..b4314480 100644 --- a/source/fitz/image.c +++ b/source/fitz/image.c @@ -923,12 +923,17 @@ fz_new_image_from_buffer(fz_context *ctx, fz_buffer *buffer) bc->params.type = FZ_IMAGE_PNG; fz_load_png_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace); } - else if (memcmp(buf, "II", 2) == 0 && buf[2] == 0xBC) + else if (buf[0] == 'I' && buf[1] == 'I' && buf[2] == 0xBC) { bc->params.type = FZ_IMAGE_JXR; fz_load_jxr_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace); } - else if (memcmp(buf, "MM", 2) == 0 || memcmp(buf, "II", 2) == 0) + else if (buf[0] == 'I' && buf[1] == 'I' && buf[2] == 42 && buf[3] == 0) + { + bc->params.type = FZ_IMAGE_TIFF; + fz_load_tiff_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace); + } + else if (buf[0] == 'M' && buf[1] == 'M' && buf[2] == 0 && buf[3] == 42) { bc->params.type = FZ_IMAGE_TIFF; fz_load_tiff_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace); |