Commit Graph

34 Commits

Author SHA1 Message Date
Scott Taylor
19a3aacc94 Add @static* annotations where they are missing.
Initialize all static vars that are not, most to `null`.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32650


git-svn-id: http://core.svn.wordpress.org/trunk@32620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 15:43:29 +00:00
Drew Jaynes
a94c16f334 Add a proper description comment for the WP_Image_Editor_GD->$image property.
See [30180]. See #30224.

Built from https://develop.svn.wordpress.org/trunk@32554


git-svn-id: http://core.svn.wordpress.org/trunk@32524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-23 19:10:28 +00:00
Scott Taylor
bf43be3e9e Add missing doc blocks to wp-image-editor*.php.
See #32444.

Built from https://develop.svn.wordpress.org/trunk@32546


git-svn-id: http://core.svn.wordpress.org/trunk@32516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-22 06:18:25 +00:00
Scott Taylor
dbc38ea246 In the ->multi_resize() method of the WP_Image_Editor subclasses, when looping through potential crops, we need to make sure the crop isn't the exact same dimensions as the original image before copying it as a new crop.
This ensures that we don't save multiple copies of the same image.

Supposedly broke in [30639], but this logic was always missing. When I tested reverting [30639], there were still 2 files being created.

Fixes #31296.

Built from https://develop.svn.wordpress.org/trunk@31576


git-svn-id: http://core.svn.wordpress.org/trunk@31557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-27 19:38:27 +00:00
Scott Taylor
de4d970d77 Preserve alpha transparency when rotating a PNG while GD is the active image editor.
Adds unit tests.

Props frankpw, voldemortensen.
Fixes #30596.

Built from https://develop.svn.wordpress.org/trunk@31040


git-svn-id: http://core.svn.wordpress.org/trunk@31021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-03 22:02:24 +00:00
Scott Taylor
e619abda6e Improve various @param docs for src/wp-includes/*.
See #30224.

Built from https://develop.svn.wordpress.org/trunk@30681


git-svn-id: http://core.svn.wordpress.org/trunk@30671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-01 01:34:24 +00:00
Scott Taylor
e02c724249 WP_Image_Editor_GD and WP_Image_Editor_Imagick should specify type in a doc block for the $image property, instead of inferring bool and null.
See #30224.

Built from https://develop.svn.wordpress.org/trunk@30180


git-svn-id: http://core.svn.wordpress.org/trunk@30180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 02:38:23 +00:00
Sergey Biryukov
221db8fd8d Fix setting default quality in WP_Image_Editor.
props markoheijnen.
fixes #29856 for trunk.
Built from https://develop.svn.wordpress.org/trunk@29834


git-svn-id: http://core.svn.wordpress.org/trunk@29598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-04 13:12:15 +00:00
Scott Taylor
6018cd50b6 Revert [28640] as per @DH-Shredder.
See #24380.

Built from https://develop.svn.wordpress.org/trunk@29345


git-svn-id: http://core.svn.wordpress.org/trunk@29123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-01 18:43:16 +00:00
Scott Taylor
cf95c6ecc2 Add ->get_quality() method to WP_Image_Editor class.
Adds unit tests.

Props markoheijnen.
Fixes #28154.

Built from https://develop.svn.wordpress.org/trunk@28879


git-svn-id: http://core.svn.wordpress.org/trunk@28678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-28 03:50:15 +00:00
Scott Taylor
552d84a8a8 In WP_Image_Editor_GD::_save(), pass $compression_level into the args array for ->make_image().
Props MuViMoTV, markoheijnen, SergeyBiryukov, mikemanger, ericlewis.
Fixes #24380.


Built from https://develop.svn.wordpress.org/trunk@28640


git-svn-id: http://core.svn.wordpress.org/trunk@28458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-30 20:06:14 +00:00
Scott Taylor
df8a090193 Add missing access modifiers to methods/members in WP_Image_Editor_* classes.
See #27881, #22234.

Built from https://develop.svn.wordpress.org/trunk@28513


git-svn-id: http://core.svn.wordpress.org/trunk@28339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-19 05:53:14 +00:00
Scott Taylor
85731fc99b In multi_resize() image editor methods, assert that null can only be passed for one of the arguments, not both. Add a lot more unit test assertions to ensure this.
Props pbearne, DH-Shredder.
Fixes #26823.


Built from https://develop.svn.wordpress.org/trunk@27794


git-svn-id: http://core.svn.wordpress.org/trunk@27630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 20:40:17 +00:00
Ryan Boren
07c16fd23c The Pinking Shears stir from their slumber, awakened by what may seem, to those
innocent in the ways of The Shears, a triviality, a nothing-of-consequence. But there are consequences indeed for recklessly trailing your whitespace. Naturally, they a dire!

One, two! One, two! And through and through
The Pinking Shears went snicker-snack!
They plucked your tail and with your space
They went sniksnuking back.

Let me tell you, that can be uncomfortable, so always pre-sniksnuk your trailing whites. May The Shears be with you.

Built from https://develop.svn.wordpress.org/trunk@26851


git-svn-id: http://core.svn.wordpress.org/trunk@26738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-11 19:49:11 +00:00
Drew Jaynes
e59ee5e974 Two more hook docs fixes.
`image_memory_limit` filter:
* Go with int|string on the limit, and simply notate '256M' as an acceptable string value.

`wp_editor_set_quality` filter:
* Add a missing parameter description for the mime type.

See #25721.

Built from https://develop.svn.wordpress.org/trunk@26650


git-svn-id: http://core.svn.wordpress.org/trunk@26540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-04 23:51:19 +00:00
Drew Jaynes
b3bc78df8f Hook docs fixes following [26645].
See #25721.

Built from https://develop.svn.wordpress.org/trunk@26648


git-svn-id: http://core.svn.wordpress.org/trunk@26538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-04 23:32:11 +00:00
Andrew Nacin
feedbcde87 Improvements to image quality handling in the image editor classes.
props markoheijnen, DH-Shredder.
fixes #25721.

Built from https://develop.svn.wordpress.org/trunk@26645


git-svn-id: http://core.svn.wordpress.org/trunk@26535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-04 22:49:10 +00:00
Drew Jaynes
4ffec6be75 Improve inline documentation for the multi_resize() method in WP_Image_Editor, WP_Image_Editor_GD, and WP_Image_Editor_Imagick.
Props paolal for the initial patch.
Fixes #25530.

Built from https://develop.svn.wordpress.org/trunk@25728


git-svn-id: http://core.svn.wordpress.org/trunk@25641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-08 17:19:09 +00:00
Ryan Boren
46ae92b9e4 Fix editing images with GD when using streams.
Props rmccue, markoheijnen, nacin
fixes #24459


git-svn-id: http://core.svn.wordpress.org/trunk@24727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-17 21:16:44 +00:00
Andrew Nacin
feffc2716f Image editors: multi_resize() should require height and width. Crop is now optional and defaults to false. props DH-Shredder. fixes #23884.
git-svn-id: http://core.svn.wordpress.org/trunk@24055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-22 20:28:05 +00:00
Ryan Boren
6806d48a90 Preserve alpha in WP_Image_Editor_GD when images are not resized.
Props joehoyle
see #23039


git-svn-id: http://core.svn.wordpress.org/trunk@23884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-01 15:21:19 +00:00
Ryan Boren
87db798028 Clarify phpdoc for the vertical and horizontal arguments to the flip() method in WP_Image_Editor*.
Props dh-shredder
fixes #23775


git-svn-id: http://core.svn.wordpress.org/trunk@23750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-19 03:30:04 +00:00
Andrew Nacin
aac3ea45f3 Only unset() after we have confirmed we are not dealing with a WP_Error. props DH-Shredder. fixes #22824.
git-svn-id: http://core.svn.wordpress.org/trunk@23133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-09 17:02:22 +00:00
Andrew Nacin
8b20551951 Image editors: After cropping, request new sizes from the image. If we rely on the values passed in, they may be floats. We must see what the image results in.
Cast in update_size() for sanity.

props DH-Shredder.
fixes #22779.



git-svn-id: http://core.svn.wordpress.org/trunk@23103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 07:56:04 +00:00
Andrew Nacin
b20c0a5bd5 Image editor doc fixes. props DH-Shredder. see #6821.
git-svn-id: http://core.svn.wordpress.org/trunk@23038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 19:42:28 +00:00
Ryan Boren
d4159bf041 In wp_image_editor(), use wp_image_editor_supports() to check for rotation capabilities rather than directly checking the existence of the imagerotate function.
In WP_Image_Editor_GD::test(), check for existence of imagerotate if the rotate capability is required.

Props DH-Shredder
fixes #22597


git-svn-id: http://core.svn.wordpress.org/trunk@22863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-27 14:36:55 +00:00
Andrew Nacin
9120cf3375 WP_Image_Editor: the last stand.
* Have wp_get_image_editor() rather than WP_Image_Editor::get_instance(). Having static factory methods would be less confusing if there weren't also static methods tied to individual editor implementations.
 * Lazy-load the WP_Image_Editor base class and editor implementations.
 * Have WP_Image_Editor_GD::supports_mime_type() actually check which types it supports.
 * Deprecate gd_edit_image_support() in favor of wp_image_editor_supports().

props DH-Shredder, scribu, markoheijnen. fixes #22356. see #6821.



git-svn-id: http://core.svn.wordpress.org/trunk@22817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 09:52:16 +00:00
Ryan Boren
6472f6d39c Add abstract methods back to WP_Image_Editor and refresh phpdoc.
Props DH-Shredder, markoheijnen, kurtpayne, nacin
see #6821


git-svn-id: http://core.svn.wordpress.org/trunk@22619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-16 22:02:21 +00:00
Ryan Boren
31e669df5a Pass an attachment ID, not a file path, to _load_image_to_edit_path() from wp_crop_image(). This fixes handling of attachments that require url fopen to access the image.
Allow passing urls instead of just file paths to WP_Image_Editor_Imagick::load() and WP_Image_Editor_GD::load() so that attachments requiring URL fopen can be handled.

see #6821


git-svn-id: http://core.svn.wordpress.org/trunk@22538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 20:42:27 +00:00
Ryan Boren
d3463e4aea WP_Image_Editor improvements.
* Make test() and supports_mime_type() static.
* Add required_methods argument to get_instance(). Allows requesting an implementation that has certain methods/capabilities.
* Whitespace cleanup

Props markoheijnen
see #6821


git-svn-id: http://core.svn.wordpress.org/trunk@22510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 19:38:54 +00:00
Andrew Nacin
4a6d2bbc00 In WP_Image_Editor / wp_load_image(), use is_file() rather than file_exists() so we do not accidentally load a directory.
props benkulbertis, DH-Shredder, scribu.
fixes #17814.



git-svn-id: http://core.svn.wordpress.org/trunk@22463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-08 02:02:03 +00:00
Andrew Nacin
03794fddb3 Properly return new WP_Error objects. props bpetty. see #6812.
git-svn-id: http://core.svn.wordpress.org/trunk@22420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 17:49:00 +00:00
Ryan Boren
4d4d747adb Avoid Strict Standards warnings. Props markoheijnen. see #6821
git-svn-id: http://core.svn.wordpress.org/trunk@22119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-04 21:59:36 +00:00
Ryan Boren
b4d0be2d1a Introduce WP_Image_Editor, WP_Image_Editor_Imagick, and WP_Image_Editor_GD. Abstracts image editing API and adds support for ImageMagick.
Props DH-Shredder, kurtpayne, markoheijnen
see #6821


git-svn-id: http://core.svn.wordpress.org/trunk@22094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-01 20:59:06 +00:00