Make WordPress Core

Opened 4 years ago

Closed 17 months ago

Last modified 17 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)

comment:1 @scottconnerly4 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.

comment:2 @nacin4 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.

comment:3 @scottconnerly4 years ago

  • Keywords has-patch added; needs-patch removed

comment:4 @scottconnerly4 years ago

  • Keywords needs-testing added

comment:5 @kawauso4 years ago

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

@scottconnerly4 years ago

now using copact( ), good call.

comment:6 @markoheijnen3 years ago

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

comment:7 @ericlewis17 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.

comment:8 @DrewAPicture17 months ago

  • Milestone Awaiting Review deleted

comment:9 @SergeyBiryukov17 months ago

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

Added in [20694].

Note: See TracTickets for help on using tickets.