X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Ftiff%2Ftiff-document.c;h=146e45539e78b3eec6c65749844c6e54b5d592a7;hb=c61947c311f21a3ac470d6a482c596d33438f27b;hp=d1473a17bbd3d94908305a030f91d7a4eba8e361;hpb=31e16bd8f386dc292e60489d4a17227804bdc2e6;p=evince.git diff --git a/backend/tiff/tiff-document.c b/backend/tiff/tiff-document.c index d1473a17..146e4553 100644 --- a/backend/tiff/tiff-document.c +++ b/backend/tiff/tiff-document.c @@ -22,6 +22,7 @@ #include "config.h" +#include #include #include #include @@ -58,10 +59,10 @@ static void tiff_document_document_file_exporter_iface_init (EvFileExporterIface EV_BACKEND_REGISTER_WITH_CODE (TiffDocument, tiff_document, { - G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS, - tiff_document_document_thumbnails_iface_init); - G_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER, - tiff_document_document_file_exporter_iface_init); + EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS, + tiff_document_document_thumbnails_iface_init); + EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER, + tiff_document_document_file_exporter_iface_init); }); static TIFFErrorHandler orig_error_handler = NULL; @@ -214,9 +215,6 @@ tiff_document_render (EvDocument *document, 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; @@ -248,11 +246,15 @@ tiff_document_render (EvDocument *document, 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; - +#endif + bytes = height * rowstride; if (bytes / rowstride != height) /* overflow */