[gdk-pixbuf] tiff: Flag multi-page TIFF files



commit 09b3fc03284ac4f9a4f466ba908f9cd7309b2ced
Author: Michael Chudobiak <mjc avtechpulse com>
Date:   Tue May 25 13:15:00 2010 +0000

    tiff: Flag multi-page TIFF files
    
    Add the "multipage" option to TIFF files with multiple pages. This will
    allow applications that use gdk-pixbuf to display images to detect them,
    and offer to open them in more capable readers (such as GIMP, or
    Evince).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=335959

 gdk-pixbuf/io-tiff.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c
index 4de77b0..262b1fb 100644
--- a/gdk-pixbuf/io-tiff.c
+++ b/gdk-pixbuf/io-tiff.c
@@ -236,6 +236,11 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
                return NULL;
        }
 
+       /* Flag multi-page documents, because this loader only handles the
+          first page. The client app may wish to warn the user. */
+        if (TIFFReadDirectory (tiff))
+                gdk_pixbuf_set_option (pixbuf, "multipage", "yes");
+
 #if G_BYTE_ORDER == G_BIG_ENDIAN
        /* Turns out that the packing used by TIFFRGBAImage depends on 
          * the host byte order... 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]