Make WordPress Core

Opened 4 weeks ago

Last modified 5 days ago

#61428 accepted defect (bug)

Inconsistent image scaling error

Reported by: gauravsingh7's profile gauravsingh7 Owned by: joedolson's profile joedolson
Milestone: 6.7 Priority: normal
Severity: normal Version: trunk
Component: Media Keywords: has-patch has-testing-info
Focuses: Cc:

Description

Here is how you can reproduce the error:

  1. Let's say the original res of my image is 356 x 216
  2. Edit the image, and downscale it to 200 x 121 and save it.
  3. Now edit the image again, and click on RESTORE ORIGINAL IMAGE
  4. Click on Scale button again and change the resolution to something like 230 x 139
  5. You will see a warning like this: "Images cannot be scaled to a size larger than the original."
  6. Since the original image was 356 x 216 and we also restored the original resolution after downscaling, the above error doesn't seem correct at this point.

Here is a video link reproducing the error: https://www.dropbox.com/scl/fi/14w4wf5qgdudjl9temqyr/media-size-limit-scale-bug.mp4?rlkey=p992w2xpvql4twvfc66egta51&st=csvui9ji&dl=1

Attachments (1)

61428.patch (1.1 KB) - added by gauravsingh7 4 weeks ago.
Adding a patch for fixing this issue!

Download all attachments as: .zip

Change History (11)

@gauravsingh7
4 weeks ago

Adding a patch for fixing this issue!

#1 @gauravsingh7
4 weeks ago

  • Keywords has-patch added; needs-patch removed

Kindly test and review the patch, and let me know if any improvements are required.
Thanks!

This ticket was mentioned in Slack in #core by gauravsingh7. View the logs.


4 weeks ago

This ticket was mentioned in PR #6821 on WordPress/wordpress-develop by gauravsingh777.


4 weeks ago
#3

TRAC: https://core.trac.wordpress.org/ticket/61428

Fixed the incorrect scaling message when an image is downscaled after it's been restored to its original size

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


2 weeks ago

#5 @joedolson
2 weeks ago

  • Milestone changed from Awaiting Review to 6.7
  • Owner set to joedolson
  • Status changed from new to accepted

#6 @rishavdutta
10 days ago

I have tested the patch for this trac ticket but the issue is not yet resolved, I have attached the screen-recording about the error message that is comming up for the re-scaling the image.

Screen-recording URL:- https://drive.google.com/file/d/1kb6eCwihdSMRR0gTJA1BgwxhNy5T-jNA/view?usp=drive_link

Environment

  • WordPress: 6.7-alpha-58576-src
  • PHP: 8.2.20
  • Server: nginx/1.27.0
  • Database: mysqli (Server: 8.0.37 / Client: mysqlnd 8.2.20)
  • Browser: Chrome 126.0.6478.127 (macOS)
  • Theme: Twenty Twenty-Four (twentytwentyfour) 1.1
Last edited 10 days ago by rishavdutta (previous) (diff)

#7 @rishavdutta
8 days ago

  • Keywords has-testing-info added

#8 @gauravsingh7
8 days ago

Hi @rishavdutta

It's possible the js file was not refreshed on your build.
Since the js file changes was added in /src/js/_enqueues directory, you'll need to build the project again so that the file is included at its correct location.

Can you confirm if you rebuilt it (npm run dev) and still got the same issue?

Last edited 5 days ago by gauravsingh7 (previous) (diff)

#9 @rishavdutta
5 days ago

Hi @gauravsingh7,
Yes, I have tested the patch again, after refreshing the build files. Now, it's working fine as expected, the error message is not coming up.
Reference Screenshot - https://drive.google.com/file/d/1yuutSFb4zdxu47SgN1xGiNJ4fyzOlBUZ/view?usp=sharing

Environment

  • WordPress: 6.7-alpha-58576-src
  • PHP: 8.2.20
  • Server: nginx/1.27.0
  • Database: mysqli (Server: 8.0.37 / Client: mysqlnd 8.2.20)
  • Browser: Chrome 126.0.6478.127 (macOS)
  • Theme: Twenty Twenty-Four (twentytwentyfour) 1.1

Thanks for the patch,

#10 @gauravsingh7
5 days ago

@rishavdutta Great! Thanks for the udpate.

Note: See TracTickets for help on using tickets.