WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 4 months ago

#26381 assigned defect (bug)

Scaling Image Up Fails Silently

Reported by: bandonrandon Owned by: markoheijnen
Milestone: Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: needs-patch
Focuses: Cc:
PR Number:

Description (last modified by SergeyBiryukov)

The ability to scale images up was removed (I think in 3.5) and the text was changed in r24562 per this ticket #23713.

However, when using the Image editor to scale an image if you enter a value larger than the image we still attempt to re-size the image and the "Restore Original link appears"

To Reproduce

1) Select an image from the media library and click the "Edit Image" button
https://i.cloudup.com/FI6vrPykAw-3000x3000.png

2) Enter dimensions larger than the original dimensions. You will see a red "!" as a warning but ignore this and click the "Scale" button
https://i.cloudup.com/00DyBO7Rb5-3000x3000.png

3) The site will try to re-size the image and gives a success message.
https://i.cloudup.com/VLRLKcN8N5-3000x3000.png

The only problem is that no new image was created. To fix this we either need to give a warning and not produce a "Restore Original Image" link or prevent the user from clicking the link at all.

My vote is since we already have JavaScript that detects when the image is too large the simplest solution would be to disable the "Scale" button when the warning "!" shows.

Change History (10)

#1 @bandonrandon
6 years ago

#26382 was marked as a duplicate.

#2 in reply to: ↑ description @bandonrandon
6 years ago

related: #23713

#3 @SergeyBiryukov
6 years ago

  • Description modified (diff)
  • Version changed from trunk to 3.5

#4 @markoheijnen
6 years ago

It wasn't remove in 3.5. I think it was never really possible. The code changes made in 3.5 had nothing to do with scaling restrictions.

#6 @wonderboymusic
5 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to markoheijnen
  • Status changed from new to assigned

markoheijnen - please take a look again and see if this needs to be dealt with

#7 @mikeschroder
5 years ago

Seems like it might make sense to disable the Scale button if we know we can't resize. We're already showing an indicator, but there's no reason to allow a user to attempt to resize if it's just going to fail.

#8 @markoheijnen
5 years ago

Another option is to revert the given size to the original size when it's to big.

#9 @mikeschroder
5 years ago

Yeah, just changing the field to match the current dimension (and hence max resize value) when a user attempts to set it higher would make sense.

#10 @chriscct7
4 years ago

  • Keywords needs-patch added
Note: See TracTickets for help on using tickets.