Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11473 closed defect (bug) (fixed)

error on resize picture in media

Reported by: jsarson Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Editor Keywords:
Focuses: Cc:


When I try to resize (scale) image in media library, It return error message: Error while saving the scaled image. Please reload the page and try again.

Problem is only with some pictures with "bad" resolution and it doesnt fit this condition correctly (different is about 0.01 - 0.03):
check if it has roughly the same w / h ratio
if ( round($sX / $sY, 1) == round($fwidth / $fheight, 1) )

Change History (4)

#1 @jsarson
11 years ago

Sorry, I copy bad "fix" code, in original code is round(..., 2)

#2 @azaozz
11 years ago

Can't reproduce this. What is the image resolution you're trying? This is mostly a sanity check. Would changing it to something like this work:

$diff = round($sX / $sY, 2) - round($fwidth / $fheight, 2);
if ( -0.05 < $diff && $diff < 0.05 )

#3 @azaozz
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [12446]) Fix the scale image check in image editor, fixes #11473 for trunk

#4 @azaozz
11 years ago

(In [12447]) Fix the scale image check in image editor, fixes #11473 for 2.9

Note: See TracTickets for help on using tickets.