Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#10528 closed task (blessed) (fixed)

Media rotating, cropping, resizing etc in 2.9.

Reported by: JohnMyr Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version:
Component: Media Keywords: rotating, cropping, resizing
Focuses: Cc:


Im not sure if its appropriate to post this ticket, but I didnt find any tickets for media rotation, cropping etc.

Adding some basic editing functions like 90-degree rotation, cropping and resizing was considered an obvious winner in the dev chat, and as several plugins handle this functionality, we’re hopeful it will be included soon.

I propose including of the Scissors plugin by Stephan Reiter:

Its matured and well tested and has nice usability features and uses jQuery.

Attachments (1)

media.zip (18.5 KB) - added by stephanreiter 6 years ago.
Plugin that implements an image editor - GUI needs work, code needs to be intergrated into WP code

Download all attachments as: .zip

Change History (21)

#1 follow-up: @JohnMyr
6 years ago

  • Component changed from Canonical to Media
  • Owner markjaquith deleted

#2 @stephanreiter
6 years ago

  • Cc stephan.reiter@… added

#3 in reply to: ↑ 1 @JohnMyr
6 years ago

Replying to JohnMyr:

Dont know why this happened, certainly not an intention by me: owner markjaquith deleted

#4 @dd32
6 years ago

Dont know why this happened

You changed the component, So the owner changed. Dont worry about it.

#5 @janeforshort
6 years ago

I believe Andrew was going to be working on this feature.

#6 @azaozz
6 years ago

Related ticket: #7042

The challenge here is that imagerotate() is "...only available if PHP is compiled with the bundled version of the GD library". There are replacement functions but they are very slow especially for large images as they copy the source image pixel by pixel.

Perhaps we can do image rotation only when the function is available. Image flip can be done with imagecopyresampled() (the same function used for resizing) and cropping with Jcrop.

#7 @junsuijin
6 years ago

Image rotation is also available through another commonly-provided/easily-installed suite, ImageMagick. There is already a php class that is extremely simple to use and can be substituted in case the GD imagerotate is unavailable. See http://us2.php.net/manual/en/function.imagick-rotateimage.php for details. I think it would be nice to fall back on the imagick version of rotation and whatever else imagick supports that can't be accomplished without a bundled GD library, rather than leaving such functions unavailable. ImageMagick can be easier to install in cases where the bundled GD library is not readily available as a package.

#8 @azaozz
6 years ago

Yes, was looking at ImageMagick too. It seems less web hosts offer it and generally it's available in addition to GD. Still the proper way would probably be to check for imagerotate and Imagick, then disable rotation if neither is present. Will also need to compare them (less server resources, better quality, faster).

6 years ago

Plugin that implements an image editor - GUI needs work, code needs to be intergrated into WP code

#9 @azaozz
6 years ago

First run in [11911].

This is far from ready, still need to separate the image meta in at least 3 different rows and implement some way to delete unneeded backup images. Also have to add support for ImageMagick when GD rotate is not available and auto-rotation of the uploaded image when EXIF orientation is set.

#10 @azaozz
6 years ago

(In [11965]) Image Editor improvements, see #10528

#11 @azaozz
6 years ago

(In [11967]) Image Editor: fix JS prompt, add size to 'load_image_to_edit' filter, see #10528

#12 @azaozz
6 years ago

(In [11972]) Image Editor: fix minified CSS, see #10528

#13 @azaozz
6 years ago

(In [11973]) Image Editor: fix preview size calculation when cropping small part of a very large image, see #10528

#14 @azaozz
6 years ago

(In [11984]) Image Editor: add load and save image filters, fix backup sizes meta, see #10528

#15 @azaozz
6 years ago

(In [11985]) Image Editor: fix refreshing of the thumbnail, use WP_Http_Fopen::test(), see #10528

#16 @azaozz
6 years ago

(In [12155]) Add 'IMAGE_EDIT_OVERWRITE' constant to control edited image save or replace, most useful for setups that have dynamic image resizing, see #10528

#17 @ryan
6 years ago

  • Type changed from feature request to task (blessed)

#18 @miqrogroove
6 years ago

-1, core bloat.

#19 @pavelevap
6 years ago

  • Cc pavelevap@… added

Sorry, but I do not understand sentence "Previously edited copies of the image will not be deleted." When I restore original image then all changes are deleted ("Discard any changes and restore the original image."), I guess.

#20 @ryan
6 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.