aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/image.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/image.c b/src/image.c
index af65fdec7dc..9ba1a7972f0 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8075,18 +8075,21 @@ compute_image_size (size_t width, size_t height,
8075 int desired_width, desired_height; 8075 int desired_width, desired_height;
8076 double scale = 1; 8076 double scale = 1;
8077 8077
8078 value = image_spec_value (spec, QCscale, NULL);
8079 if (NUMBERP (value))
8080 scale = extract_float (value);
8081
8078 /* If width and/or height is set in the display spec assume we want 8082 /* If width and/or height is set in the display spec assume we want
8079 to scale to those values. If either h or w is unspecified, the 8083 to scale to those values. If either h or w is unspecified, the
8080 unspecified should be calculated from the specified to preserve 8084 unspecified should be calculated from the specified to preserve
8081 aspect ratio. */ 8085 aspect ratio. */
8082 value = image_spec_value (spec, QCwidth, NULL); 8086 value = image_spec_value (spec, QCwidth, NULL);
8083 desired_width = NATNUMP (value) ? min (XFASTINT (value), INT_MAX) : -1; 8087 desired_width = NATNUMP (value) ?
8088 min (XFASTINT (value) * scale, INT_MAX) : -1;
8084 value = image_spec_value (spec, QCheight, NULL); 8089 value = image_spec_value (spec, QCheight, NULL);
8085 desired_height = NATNUMP (value) ? min (XFASTINT (value), INT_MAX) : -1; 8090 desired_height = NATNUMP (value) ?
8091 min (XFASTINT (value) * scale, INT_MAX) : -1;
8086 8092
8087 value = image_spec_value (spec, QCscale, NULL);
8088 if (NUMBERP (value))
8089 scale = extract_float (value);
8090 width = width * scale; 8093 width = width * scale;
8091 height = height * scale; 8094 height = height * scale;
8092 8095