Make WordPress Core

Opened 2 years ago

Closed 23 months ago

Last modified 16 months ago

#61428 closed defect (bug) (fixed)

Inconsistent image scaling error

Reported by: gauravsingh7 Owned by: joedolson
Priority: normal Milestone: 6.7
Component: Media Version: 6.6
Severity: normal Keywords: has-patch has-test-info reporter-feedback
Cc: Focuses:

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 2 years ago.
Adding a patch for fixing this issue!

Download all attachments as: .zip

Change History (19)

@gauravsingh7
2 years ago

Adding a patch for fixing this issue!

#1 @gauravsingh7
2 years 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.


2 years ago

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


2 years 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 years ago

#5 @joedolson
2 years ago

  • Milestone Awaiting Review6.7
  • Owner set to joedolson
  • Status newaccepted

#6 @rishavdutta
2 years 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 2 years ago by rishavdutta (previous) (diff)

#7 @rishavdutta
2 years ago

  • Keywords has-testing-info added

#8 @gauravsingh7
2 years 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 2 years ago by gauravsingh7 (previous) (diff)

#9 @rishavdutta
2 years 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
2 years ago

@rishavdutta Great! Thanks for the udpate.

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


2 years ago

#12 @joedolson
2 years ago

Hi! I'm working on this issue, but I'm not able to reproduce the problem using the video steps as a reference on trunk. Before spending a lot of effort trying to figure out how to reproduce it, can I ask somebody who has already reproduced the issue to verify whether or not they can produce it using the current trunk version of WordPress?

I *can* reproduce it in WordPress 6.6; but it's possible that this was fixed incidentally, and I want to be able to verify that.

#13 @joedolson
2 years ago

  • Keywords reporter-feedback added

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


2 years ago

#15 @pratiklondhe
23 months ago

@joedolson , I am also unable to replicate the issue on the trunk branch, it might've been fixed already.

#16 @mikinc860
23 months ago

@joedolson I’m also unable to replicate the issue on the trunk using the video steps as a reference.

#17 @joedolson
23 months ago

  • Resolutionfixed
  • Status acceptedclosed

With three separate reports unable to replicate the issue, I'm going to close this issue as fixed. I don't know for sure where it was fixed; but I would guess it was likely in [58915].

If somebody does reproduce this again in the future, don't hesitate to reopen and provide whatever additional details are necessary to reproduce.

#18 @wordpressdotorg
16 months ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.