File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -365,12 +365,16 @@ private function compareImages ($image1, $image2)
365365 $ imagick1 = new \Imagick ($ image1 );
366366 $ imagick2 = new \Imagick ($ image2 );
367367
368- $ maxWidth = max ($ imagick1 ->getImageGeometry ()['width ' ], $ imagick2 ->getImageGeometry ()['width ' ]);
369- $ maxHeight = max ($ imagick1 ->getImageGeometry ()['height ' ], $ imagick2 ->getImageGeometry ()['height ' ]);
368+ $ imagick1Size = $ imagick1 ->getImageGeometry ();
369+ $ imagick2Size = $ imagick2 ->getImageGeometry ();
370+
371+ $ maxWidth = max ($ imagick1Size ['width ' ], $ imagick2 ->getImageGeometry ()['width ' ]);
372+ $ maxHeight = max ($ imagick2Size ['height ' ], $ imagick2 ->getImageGeometry ()['height ' ]);
370373
371374 $ imagick1 ->extentImage ($ maxWidth , $ maxHeight , 0 , 0 );
372375 $ imagick2 ->extentImage ($ maxWidth , $ maxHeight , 0 , 0 );
373376
377+
374378 try {
375379 $ result = $ imagick1 ->compareImages ($ imagick2 , \Imagick::METRIC_MEANSQUAREERROR );
376380 $ result [0 ]->setImageFormat ("png " );
You can’t perform that action at this time.
0 commit comments