From c732cd69db005902289829867a71e0d271809aba Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 21 Feb 2012 22:47:03 +0100 Subject: Set default DPI in jpeg images if the file says 0. --- fitz/image_jpeg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fitz/image_jpeg.c b/fitz/image_jpeg.c index f53b6124..cef53d93 100644 --- a/fitz/image_jpeg.c +++ b/fitz/image_jpeg.c @@ -115,6 +115,9 @@ fz_load_jpeg(fz_context *ctx, unsigned char *rbuf, int rlen) image->yres = cinfo.Y_density * 254 / 100; } + if (image->xres <= 0) image->xres = 72; + if (image->yres <= 0) image->yres = 72; + fz_clear_pixmap(ctx, image); row[0] = fz_malloc(ctx, cinfo.output_components * cinfo.output_width); -- cgit v1.2.3