Make WordPress Core

Opened 4 years ago

Closed 19 months ago

Last modified 18 months ago

#18835 closed enhancement (fixed)

Add filter to image_resize_dimensions( ) return values

Reported by: scottconnerly Owned by:
Milestone: 3.4 Priority: normal
Severity: minor Version: 3.2.1
Component: Media Keywords:
Focuses: Cc:


Requesting a filter on the values about to be returned, including access to the function's original arguments.

Use case:
Currently, any cropping happens to images always crops to the top-left corner (0,0). Want to be able to write a plugin that will allow cropping with more options (say, crop out at the middle of the image, etc).

Attachments (1)

media.diff (703 bytes) - added by scottconnerly 4 years ago.
now using copact( ), good call.

Download all attachments as: .zip

Change History (10)

#1 @scottconnerly
4 years ago

Found #15989 - same use case, he just proposes making it core functionality. Hoping my ticket will be approved as it is less invasive.

#2 @nacin
4 years ago

If you can provide a patch, I'd be interested. The lack of a filter here is annoying and very much a bug.

#3 @scottconnerly
4 years ago

  • Keywords has-patch added; needs-patch removed

#4 @scottconnerly
4 years ago

  • Keywords needs-testing added

#5 @kawauso
4 years ago

It'd be worth using compact() for the 3rd parameter to make it more readable.

4 years ago

now using copact( ), good call.

#6 @markoheijnen
3 years ago

Is this something that can be addressed for in 3.5? Seems like it fits the focus

#7 @ericlewis
19 months ago

  • Keywords has-patch needs-testing removed
  • Resolution set to invalid
  • Status changed from new to closed

The filter image_resize_dimensions was added in 3.4, so you're good to go here. Closing out.

#8 @DrewAPicture
19 months ago

  • Milestone Awaiting Review deleted

#9 @SergeyBiryukov
18 months ago

  • Milestone set to 3.4
  • Resolution changed from invalid to fixed

Added in [20694].

Note: See TracTickets for help on using tickets.