summaryrefslogtreecommitdiff
path: root/source/html
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-03-31 11:46:15 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-07-21 16:45:54 +0200
commitd65dc510257518bb957e1caff840f9d46f1511b3 (patch)
tree642a667863dc6774ff938d12cd6059378ea5c424 /source/html
parentd44fb06a32a60c720ba1718fead002d67d56ca2a (diff)
downloadmupdf-d65dc510257518bb957e1caff840f9d46f1511b3.tar.xz
Ignore image resolution in EPUB files.
Many images in EPUB files have bogus values for the DPI. Use 96 dpi for all EPUB images, since that matches best what web browsers do with images in HTML.
Diffstat (limited to 'source/html')
-rw-r--r--source/html/html-layout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index 9aacf09b..583464ed 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -790,8 +790,9 @@ generate_boxes(fz_context *ctx, fz_xml *node, fz_html_box *top,
static void measure_image(fz_context *ctx, fz_html_flow *node, float max_w, float max_h)
{
float xs = 1, ys = 1, s = 1;
- float image_w = node->content.image->w * 72.0f / node->content.image->xres;
- float image_h = node->content.image->h * 72.0f / node->content.image->yres;
+ /* NOTE: We ignore the image DPI here, since most images in EPUB files have bogus values. */
+ float image_w = node->content.image->w * 72 / 96;
+ float image_h = node->content.image->h * 72 / 96;
node->x = 0;
node->y = 0;
if (image_w > max_w)