[wp-trac] [WordPress Trac] #23424: WP_Image class for handling images from the media library
WordPress Trac
noreply at wordpress.org
Fri Feb 8 15:41:25 UTC 2013
#23424: WP_Image class for handling images from the media library
--------------------------------------+-------------------------
Reporter: markoheijnen | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Media
Version: 3.5 | Severity: normal
Keywords: needs-patch dev-feedback |
--------------------------------------+-------------------------
Since 3.5 we have the class WP_Image_Editor. This needs a file path to be
able to manipulate an image. Currently you would have to use something
like wp_get_image_editor( _load_image_to_edit_path( $post_id ) ). What is
wrong since you are using a "private" function.
Currently I'm working on this idea and you can find the code here
https://github.com/markoheijnen/WP_Image/blob/master/wp-image.php. What it
does now is getting the filepath, be able to get the image editor, add an
image size on the fly and getting/updating the metadata.
We really miss something like a WP_Image class in WordPress. However I'm
not sure what kind of functionality is needed for it. I like the current
class mainly because it gives you the power to create an image size for a
specific media image and stores it in the sizes array. When a user removes
the media image then also the custom sizes will be removed.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23424>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list