WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 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:

Description

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:
http://wordpress.org/extend/plugins/scissors/

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

Attachments (1)

media.zip (18.5 KB) - added by stephanreiter 5 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)

comment:1 follow-up: JohnMyr5 years ago

  • Component changed from Canonical to Media
  • Owner markjaquith deleted

comment:2 stephanreiter5 years ago

  • Cc stephan.reiter@… added

comment:3 in reply to: ↑ 1 JohnMyr5 years ago

Replying to JohnMyr:

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

comment:4 dd325 years ago

Dont know why this happened

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

comment:5 janeforshort5 years ago

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

comment:6 azaozz5 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.

comment:7 junsuijin5 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.

comment:8 azaozz5 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).

stephanreiter5 years ago

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

comment:9 azaozz5 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.

comment:10 azaozz5 years ago

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

comment:11 azaozz5 years ago

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

comment:12 azaozz5 years ago

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

comment:13 azaozz5 years ago

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

comment:14 azaozz5 years ago

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

comment:15 azaozz5 years ago

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

comment:16 azaozz4 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

comment:17 ryan4 years ago

  • Type changed from feature request to task (blessed)

comment:18 miqrogroove4 years ago

-1, core bloat.

comment:19 pavelevap4 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.

comment:20 ryan4 years ago

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