]> www.fi.muni.cz Git - evince.git/blobdiff - backend/tiff/tiff-document.c
Add missing #include.
[evince.git] / backend / tiff / tiff-document.c
index d1473a17bbd3d94908305a030f91d7a4eba8e361..86170e270b7f290d728cf9ba237086d52977ca8f 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "config.h"
 
 
 #include "config.h"
 
+#include <config.h>
 #include <stdio.h>
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <stdio.h>
 #include <glib.h>
 #include <glib/gi18n.h>
@@ -214,9 +215,6 @@ tiff_document_render (EvDocument      *document,
        gint rowstride, bytes;
        guchar *pixels = NULL;
        guchar *p;
        gint rowstride, bytes;
        guchar *pixels = NULL;
        guchar *p;
-       GdkPixbuf *pixbuf;
-       GdkPixbuf *scaled_pixbuf;
-       GdkPixbuf *rotated_pixbuf;
        cairo_surface_t *surface;
        cairo_surface_t *rotated_surface;
        static const cairo_user_data_key_t key;
        cairo_surface_t *surface;
        cairo_surface_t *rotated_surface;
        static const cairo_user_data_key_t key;
@@ -248,11 +246,15 @@ tiff_document_render (EvDocument      *document,
        if (width <= 0 || height <= 0)
                return NULL;                
 
        if (width <= 0 || height <= 0)
                return NULL;                
 
+#ifdef HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH
+       rowstride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width);
+#else
        rowstride = width * 4;
        if (rowstride / 4 != width)
                /* overflow */
                return NULL;                
        rowstride = width * 4;
        if (rowstride / 4 != width)
                /* overflow */
                return NULL;                
-        
+#endif
+       
        bytes = height * rowstride;
        if (bytes / rowstride != height)
                /* overflow */
        bytes = height * rowstride;
        if (bytes / rowstride != height)
                /* overflow */