Opened 6 months ago
Closed 6 months ago
#22597 closed defect (bug) (fixed)
Image Editor checking GD directly for rotate support
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | 3.5 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | scribu |
Description
The image editor is currently checking imagerotate() directly to decide whether it should enable the rotate buttons.
We should be checking the image editor.
The initial patch is a bit creative because we assume rotate() is a required function with the WP_Image_Editor class.
Attachments (4)
Change History (12)
DH-Shredder — 6 months ago
DH-Shredder — 6 months ago
comment:1
DH-Shredder — 6 months ago
comment:2
markoheijnen — 6 months ago
- Milestone changed from Awaiting Review to 3.5
array( 'methods', array( 'rotate' ) ) — this should be 'methods' => array( 'rotate' ), I imagine?
DH-Shredder — 6 months ago
comment:5
DH-Shredder — 6 months ago
DH-Shredder — 6 months ago
Also passes the mime_type for a more correct response, although this requires pulling the mime from the post.
comment:6
DH-Shredder — 6 months ago
As a second option, 22597.4.diff also passes mime_type through to check for support.
This requires pulling the mime from the post, though.
It is more accurate, however, since you could get in a situation where rotate() is supported by an editor, but the mime type is not (for instance, in the case of a GD install that is sadly lacking of imagerotate() along with a really old Imagick install lacking setIteratorIndex() when trying to rotate a GIF.
Related: #22543

Got some extra stuff accidentally in initial patch.
22597.2.diff is the proper one.