diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-02-21 22:47:03 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-02-21 22:49:11 +0100 |
commit | c732cd69db005902289829867a71e0d271809aba (patch) | |
tree | ac02176c567b773f7398b58ce043325da49cc307 | |
parent | 1404fbe67da5a72643730ee3000701c85a46a507 (diff) | |
download | mupdf-c732cd69db005902289829867a71e0d271809aba.tar.xz |
Set default DPI in jpeg images if the file says 0.
-rw-r--r-- | fitz/image_jpeg.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |