Skip to content

Commit dc360ce

Browse files
author
Cristy
committed
https://github.com/ImageMagick/ImageMagick/issues/8375
1 parent b3dece0 commit dc360ce

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

coders/jpeg.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,8 +1251,6 @@ static Image *ReadJPEGImage_(const ImageInfo *image_info,
12511251
/*
12521252
Set image resolution.
12531253
*/
1254-
image->x_resolution=DefaultResolution;
1255-
image->y_resolution=DefaultResolution;
12561254
units=0;
12571255
if (jpeg_info->saw_JFIF_marker != 0)
12581256
{
@@ -1272,11 +1270,10 @@ static Image *ReadJPEGImage_(const ImageInfo *image_info,
12721270
*/
12731271
if ((jpeg_info->X_density != 0) && (jpeg_info->Y_density != 0))
12741272
{
1275-
double aspect_ratio = (double) jpeg_info->Y_density/
1276-
(double) jpeg_info->X_density;
1273+
double aspect_ratio = (double) jpeg_info->Y_density*
1274+
MagickSafeReciprocal((double) jpeg_info->X_density);
12771275
image->y_resolution=image->x_resolution*aspect_ratio;
12781276
}
1279-
units=1;
12801277
}
12811278
}
12821279
if (units == 1)

0 commit comments

Comments
 (0)