Make WordPress Core

Opened 12 years ago

Closed 10 years ago

Last modified 10 years ago

#21959 closed enhancement (wontfix)

No way to override the name of an image when that is being resized

Reported by: jkmassel's profile jkmassel Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.2
Component: Media Keywords: needs-docs needs-refresh
Focuses: Cc:

Description

The most obvious solution is to add a hook to allow the destination file name to be modified.

The solution attached gives pretty much all the information you could possibly want to modify the filename as you might need to.

Attachments (2)

media_destination_file_name_hook.diff (707 bytes) - added by jkmassel 12 years ago.
A fix for this issue
21959.patch (559 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (8)

@jkmassel
12 years ago

A fix for this issue

#1 @jkmassel
12 years ago

  • Cc jeremy.massel@… added

#2 follow-up: @SergeyBiryukov
12 years ago

$destfilename needs to be a string, not an array. Additional information can be passed as extra arguments.

#3 in reply to: ↑ 2 @jkmassel
12 years ago

Replying to SergeyBiryukov:

$destfilename needs to be a string, not an array. Additional information can be passed as extra arguments.

Ah interesting. Thanks for the info!

#4 @DrewAPicture
11 years ago

  • Keywords needs-refresh close added; has-patch needs-codex removed

As of 3.5, the code the patch modifies has been deprecated.

If this is still something you'd like to pursue, I suggest looking at the _save() methods in WP_Image_Editor_GD and WP_Image_Editor_Imagick as a starting place.

#5 @wonderboymusic
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

image_make_intermediate_size = "Filter the name of the saved image file."

Note: See TracTickets for help on using tickets.