+2005-07-02 Matthew S. Wilson <msw@rpath.com>
+
+ * tiff/tiff-document.c (tiff_document_get_page_size): scale the
+ reported height by using the resolution aspect ratio
+ (tiff_document_render_pixbuf): scale the pixbuf using the
+ resolution aspect ratio
+
2005-07-01 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
* configure.ac:
if (tiff)
{
guint32 w, h;
-
+ /* FIXME: unused data? why bother here */
TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &h);
}
double *height)
{
guint32 w, h;
+ gfloat x_res, y_res;
TiffDocument *tiff_document = TIFF_DOCUMENT (document);
g_return_if_fail (TIFF_IS_DOCUMENT (document));
TIFFGetField (tiff_document->tiff, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField (tiff_document->tiff, TIFFTAG_IMAGELENGTH, &h);
+ TIFFGetField (tiff_document->tiff, TIFFTAG_XRESOLUTION, &x_res);
+ TIFFGetField (tiff_document->tiff, TIFFTAG_YRESOLUTION, &y_res);
+ h = h * (x_res / y_res);
if (tiff_document->orientation == EV_ORIENTATION_PORTRAIT ||
tiff_document->orientation == EV_ORIENTATION_UPSIDEDOWN) {
{
TiffDocument *tiff_document = TIFF_DOCUMENT (document);
int width, height;
+ float x_res, y_res;
gint rowstride, bytes;
guchar *pixels = NULL;
GdkPixbuf *pixbuf;
return NULL;
}
+ if (!TIFFGetField (tiff_document->tiff, TIFFTAG_XRESOLUTION, &x_res))
+ {
+ pop_handlers ();
+ return NULL;
+ }
+
+ if (! TIFFGetField (tiff_document->tiff, TIFFTAG_YRESOLUTION, &y_res))
+ {
+ pop_handlers ();
+ return NULL;
+ }
+
pop_handlers ();
/* Sanity check the doc */
scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf,
width * rc->scale,
- height * rc->scale,
+ height * rc->scale * (x_res/y_res),
GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);