File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments