Commit Graph

150 Commits

Author SHA1 Message Date
Mike Schroder
a8e304ec8e Media: Add support for rendering PDF thumbnails.
When support for PDFs is available, on upload,
render 'Thumbnail', 'Medium', 'Large', and 'Full' sizes of
the first page, and save them in attachment meta.

Use these renders within Add Media, Media Gallery and List views,
Attachment Details, Post/Attachment Edit screens, and Attachment pages.

Support available by default via Imagick -> ImageMagick -> Ghostscript,
but can be provided by any `WP_Image_Editor` that supports PDFs.

Props adamsilverstein, azaozz, celloexpressions, desrosj, dglingren, ericlewis, ipstenu, joemcgill, joyously, markoheijnen, melchoyce, mikeschroder, tomauger.
Fixes #31050.
Built from https://develop.svn.wordpress.org/trunk@38949


git-svn-id: http://core.svn.wordpress.org/trunk@38892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 07:28:32 +00:00
Scott Taylor
6f9f3b0c56 Media: remove function_exists() call for ini_get() in _load_image_to_edit_path().
Props dd32.
Fixes #37681.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-23 14:24:30 +00:00
Scott Taylor
d31456b615 Media: add a function, wp_get_additional_image_sizes(), that wraps the retrieval of the global $_wp_additional_image_sizes. Removes 6 global imports.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-22 04:37:28 +00:00
Drew Jaynes
c3055cc190 Docs: Standardize hook docs in wp-admin/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:01:30 +00:00
Dominik Schilling
d8f3325c14 Docs: Correct grammar when referring to "a URL" vs "an URL" in several places.
Fixes #36218.
Built from https://develop.svn.wordpress.org/trunk@36970


git-svn-id: http://core.svn.wordpress.org/trunk@36938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-12 12:39:27 +00:00
Dominik Schilling
cd892b86b4 Media: In wp_read_image_metadata() make sure that IPTC keywords are UTF8 encoded.
Prevents missing `_wp_attachment_metadata` when an image contains keywords with latin extended characters.

Fixes #35316.
Built from https://develop.svn.wordpress.org/trunk@36429


git-svn-id: http://core.svn.wordpress.org/trunk@36396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-01 14:53:27 +00:00
Drew Jaynes
79705d5cc1 Docs: Fix a typo in the 4.4.0 changlog entry in the intermediate_image_sizes_advanced hook doc.
Props morganestes.
Fixes #35190.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-21 22:24:27 +00:00
Sergey Biryukov
7ad65267b6 Media: Avoid a PHP warning in wp_generate_attachment_metadata() if $metadata is not an array.
This was previously fixed in [25968], but accidentally reverted in [32545].

Props skithund.
Fixes #34599.
Built from https://develop.svn.wordpress.org/trunk@35554


git-svn-id: http://core.svn.wordpress.org/trunk@35518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-06 09:25:26 +00:00
Scott Taylor
aa8c76258a After [34374], ensure that $iptc is defined.
See #33772.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 04:49:24 +00:00
Scott Taylor
1d513fe737 Media: In wp_read_image_metadata(), include IPTC Keywords when available in $meta.
Adds unit test.

Props swissspidy, dbru, SteveHoneyNZ.
Fixes #33772.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 04:19:24 +00:00
Scott Taylor
8cd584e6ed In wp_generate_attachment_metadata(), also pass $metadata to the intermediate_image_sizes_advanced filter.
Props amereservant, wonderboymusic.
Fixes #23401.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 18:04:24 +00:00
Scott Taylor
b56b9b3e5c Add @global annotations for wp-admin/*.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 21:41:30 +00:00
Scott Taylor
af7a017f46 When calling unset(), it is unnecessary to immediately precede it with a call to isset().
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-22 05:47:25 +00:00
Sergey Biryukov
19f1d4f402 EXIF/IPTC captions should populate Caption (post_excerpt) on upload, not Description (post_content).
Make sure the caption is always set if found. Previously, if the caption was less than 80 characters, only the Title field would be set.

props beaulebens, ericlewis, bendoh, SergeyBiryukov.
fixes #22768.
Built from https://develop.svn.wordpress.org/trunk@31694


git-svn-id: http://core.svn.wordpress.org/trunk@31675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-10 05:07:28 +00:00
Scott Taylor
8f0b626d13 Introduce a function, wp_attachment_is( $type, $post = 0 ), to collapse the logic for determining whether an attachment is an image, audio, or video.
This is admittedly a first pass. There needs to be a generic handler for when any other type is passed, but for now it accepts the whitelist.

See #25275.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-06 20:26:26 +00:00
Sergey Biryukov
19a43125cd Don't try to read a non-existent Exif:Title tag in wp_read_image_metadata(), as it's not a part of the Exif standard.
props tyxla.
fixes #31043.
Built from https://develop.svn.wordpress.org/trunk@31462


git-svn-id: http://core.svn.wordpress.org/trunk@31443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-14 09:14:28 +00:00
Scott Taylor
4feecb922c Use && instead of and in the 3 places where and was used.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 21:12:22 +00:00
Andrew Nacin
58dfcb9bb0 Validate image data.
Built from https://develop.svn.wordpress.org/trunk@30458


git-svn-id: http://core.svn.wordpress.org/trunk@30449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-20 15:25:22 +00:00
Scott Taylor
2ed316e16d Add exif orientation to data extracted in wp_read_image_metadata().
Props shanebp.
Fixes 28916.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-24 22:14:16 +00:00
Drew Jaynes
097dc8ee15 Fix syntax for single- and multi-line comments in wp-admin-directory files.
See #28931.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-17 09:14:16 +00:00
Sergey Biryukov
8b272f4379 Remove mbstring_binary_safe_strlen(). Use mbstring_binary_safe_encoding() and reset_mbstring_encoding() directly.
fixes #28162.
Built from https://develop.svn.wordpress.org/trunk@28808


git-svn-id: http://core.svn.wordpress.org/trunk@28617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-23 22:21:15 +00:00
Sergey Biryukov
9ceb642b2a Introduce a binary-safe wrapper for strlen() and use it in seems_utf8(), utf8_uri_encode(), and wp_read_image_metadata().
Use binary-safe POMO_Reader::strlen() in MO::export_to_file_handle().

fixes #28162.
Built from https://develop.svn.wordpress.org/trunk@28806


git-svn-id: http://core.svn.wordpress.org/trunk@28615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-23 14:48:14 +00:00
Sergey Biryukov
84422e6d7d Add BMP to the list of displayable image types.
props ericlewis.
fixes #26808.
Built from https://develop.svn.wordpress.org/trunk@28589


git-svn-id: http://core.svn.wordpress.org/trunk@28414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-27 13:25:14 +00:00
Scott Taylor
88b96dc036 In wp_read_image_metadata(), the values from exif_read_data() should only override values from iptcparse() that are empty.
Props SergeyBiryukov.
Fixes #23706.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-11 05:54:15 +00:00
Drew Jaynes
181fe84d47 Align parameters in the hook docs for the attachment_thumbnail_args filter.
See #27700.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 20:10:16 +00:00
Scott Taylor
7eb24edf4e In wp_generate_attachment_metadata(), when an audio or video files contains upload-able image bits in its ID3 tags, only upload it if the image has not already been uploaded. Determine this by checking for a _cover_hash value in post meta that matches the md5 representation of the bits.
This prevents uploading an album of 10 songs and subsequently uploading 10 copies of the same album cover.

Props GregLone for the new filter/filter docs: `'attachment_thumbnail_args'`.
Fixes #27573.
 

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


git-svn-id: http://core.svn.wordpress.org/trunk@27694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-30 20:54:15 +00:00
Scott Taylor
38d1fb971f Turn on thumbnail support for attachment:audio and attachment:video. Change conditionals to check for theme OR post type support when determining whether to turn on the Featured Image UI pieces in the admin.
Fixes #27460.


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


git-svn-id: http://core.svn.wordpress.org/trunk@27500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-23 02:35:14 +00:00
Andrew Nacin
fabb6d4898 Allow $crop in add_image_size() to receive crop anchors (top, left, right, bottom, center).
This also applies to set_post_thumbnail_size() and image_resize_dimensions().

props bradt, wonderboymusic, DH-Shredder.
fixes #19393.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-08 06:14:15 +00:00
Drew Jaynes
61538d3f5e Inline documentation for hooks in wp-admin/includes/image.php.
Props theorboman, kpdesign.
Fixes #25832.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-20 06:27:13 +00:00
Andrew Nacin
d0cfa40983 Add jshintrc to qunit.
props jorbin.
see #25187.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-30 14:39:10 +00:00
Mark Jaquith
12d3fc7999 Add functions for generating metadata for video and audio, using the
ID3 library. Also allows themes/plugins to add thumbnail support
to these media types. Think stuff like album art, movie covers, and
video freeze-frames.

props wonderboymusic. fixes #23673

git-svn-id: http://core.svn.wordpress.org/trunk@23766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-21 04:55:42 +00:00
Sergey Biryukov
caf591b7aa Declare the variable before using it. props danielbachhuber. fixes #23710.
git-svn-id: http://core.svn.wordpress.org/trunk@23632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-07 04:46:19 +00:00
Sergey Biryukov
2967871d34 Return WP_Error from wp_crop_image() if saving has failed. props macbrink. fixes #23325.
git-svn-id: http://core.svn.wordpress.org/trunk@23374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-02 02:01:59 +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
Andrew Nacin
f68b6006de wp_generate_attachment_metadata() should not call WP_Image_Editor if there's nothing to resize. props mdawaffe. fixes #22438.
git-svn-id: http://core.svn.wordpress.org/trunk@22571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-14 14:26:52 +00:00
Ryan Boren
02d80201fa In wp_crop_image(), preserve both src_file and src. src_file must be preserved even when url fopen is used so that we don't try to save to a filename based on the url.
see #6821


git-svn-id: http://core.svn.wordpress.org/trunk@22553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-13 00:03:55 +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
Andrew Nacin
f965ff1c84 Cast image metadata focal_length and shutter_speed to strings to restore previous behavior when stripslashes_deep() converted these values. Avoids rounding errors without making a determination of which digit we should round to. props jcakec. fixes #22259.
git-svn-id: http://core.svn.wordpress.org/trunk@22319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-28 16:17:56 +00:00
Ryan Boren
da8d7a347a Check for WP_Error return from WP_Image_Editor::get_instance().
Props markoheijnen
see #6821


git-svn-id: http://core.svn.wordpress.org/trunk@22192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-11 18:59:41 +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
Andrew Nacin
70ad7496a6 Deprecate wp_create_thumbnail(). props obenland. fixes #21555.
git-svn-id: http://core.svn.wordpress.org/trunk@21956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-23 17:48:24 +00:00
Andrew Nacin
2d1eae820f Avoid mangling UTF-8 strings that may be present in image metadata. props SergeyBiryukov for the unit tests [UT665]. fixes #9417.
git-svn-id: http://core.svn.wordpress.org/trunk@21905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 23:38:25 +00:00
Andrew Nacin
670105e1fb Remove 'hwstring_small' from attachment metadata and deprecate get_udims(). props SergeyBiryukov. fixes #21518.
git-svn-id: http://core.svn.wordpress.org/trunk@21808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-11 01:38:26 +00:00
ryan
bce8cd343a Make sure the path exists before copying. see #20657
git-svn-id: http://core.svn.wordpress.org/trunk@21039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-10 01:26:12 +00:00
azaozz
cb71d2fe62 Fix notice in wp_read_image_metadata() when EXIF ISOSpeedRatings is array, props nacin, fixes #20807
git-svn-id: http://core.svn.wordpress.org/trunk@20978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-02 01:39:00 +00:00
ryan
c0339644ea Shears of vigorous pinking.
git-svn-id: http://core.svn.wordpress.org/trunk@20944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-27 16:25:43 +00:00
ryan
b212ead08c Remove debug cruft. Fix typo. Props SergeyBiryukov. fixes #20657
git-svn-id: http://core.svn.wordpress.org/trunk@20808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-16 18:11:19 +00:00
ryan
a6894d0b59 Create a new attachment and make a copy of the image when selecting an image from the image library. This prevents orphaning the header if the original attachment is deleted. This also prevents stomping of meta.
Add a button to skip cropping.

Props SergeyBiryukov
Fixes #20657 #20667


git-svn-id: http://core.svn.wordpress.org/trunk@20806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-16 17:47:55 +00:00
ryan
52e7e65d2d Make the file names unique for cropped header images. Props SergeyBiryukov. fixes #20666
git-svn-id: http://core.svn.wordpress.org/trunk@20787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-14 17:53:03 +00:00
ryan
61ffb70037 Don't convert png to jpg when cropping a header. Prevents stomping transparency. Props SergeyBiryukov, kovshenin. fixes #20555
git-svn-id: http://core.svn.wordpress.org/trunk@20706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-02 21:35:56 +00:00
ryan
54b3b79dea Use correct var name. Props mattonomics. fixes #20432
git-svn-id: http://svn.automattic.com/wordpress/trunk@20454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-12 21:02:24 +00:00
ryan
a7f2d67f6d Make choosing a header image from the media library play nicely with file replication plugins that do not guarantee images will be retained in the local filesystem.
* When passing an attachment ID to wp_crop_image(), use load_image_to_edit() to fetch the image via a url fopen when the image does not exist in the filesystem.
* Move load_image_to_edit() to wp-admin/includes/image.php so that it is always available for admin pages loads.
* Fallback to the height and width stored in the attachment meta when the image no longer exists in the filesystem.

see #19840


git-svn-id: http://svn.automattic.com/wordpress/trunk@20384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-06 20:47:24 +00:00
ryan
83b131f8e3 User lowercase true, false, null instead of uppercase. Props c3mdigital, mfields. fixes #16302
git-svn-id: http://svn.automattic.com/wordpress/trunk@19687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-05 20:50:54 +00:00
ryan
07ff8b216b Use one space, not two, after trailing punctuation. fixes #19537
git-svn-id: http://svn.automattic.com/wordpress/trunk@19593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-13 23:45:31 +00:00
duck_
c1d1590171 Fix typos in documentation (wp-admin/). See #18560.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-03 14:18:10 +00:00
dd32
bf6510abd1 Fix image_resize() dependencies by moving wp_load_image() from admin includes to wp-includes. Fixes #7279
git-svn-id: http://svn.automattic.com/wordpress/trunk@13860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-03-28 03:39:00 +00:00
nacin
39605976b1 Use utf8_encode() consistently in wp_read_image_metadata(). Also add some whitespace. props miqrogroove, see #11417, see #12095
git-svn-id: http://svn.automattic.com/wordpress/trunk@13249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-02-20 12:09:30 +00:00
nacin
f58329a718 Improved IPTC and EXIF handling. Drag a wider net and also try to avoid numeric attachment slugs where possible. Props miqrogroove. See #11417
git-svn-id: http://svn.automattic.com/wordpress/trunk@13244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-02-20 09:17:34 +00:00
ryan
a7c1b164f6 Deprecate wp_shrink_dimension(), add wp-admin/includes/deprecated.php. Props filosofo. fixes #11967
git-svn-id: http://svn.automattic.com/wordpress/trunk@12823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-01-25 18:50:01 +00:00
westi
bf4a5241e1 Add missing version numbers to _deprecated_argument() calls.
Remove deprecated argument from xfn_check() calls.
Pass version number to deprecated_file_included, deprecated_function_run and deprecated_argument_run actions.
Fixes #11386 props nacin.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-01-09 10:03:55 +00:00
westi
cc30f8ad98 Introduce a single function for getting all the intermediate image sizes to be used both when adding attachements and deleting. Fixes #10263 props scribu.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-01-08 08:51:12 +00:00
westi
ff7831207c Updates and improvements to _depreceated_argument. See #11386 props nacin.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-12-30 16:23:39 +00:00
ryan
9b6bd6bf87 Retunr WP_Error from wp_crop_image() and image_resize(). Props mdwaffe. fixes #9922
git-svn-id: http://svn.automattic.com/wordpress/trunk@12524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-12-23 18:39:31 +00:00
markjaquith
bf264bb66d Post/Page Image was too generic a name. Post/Page Thumbnail is more clear, even if you can create very large thumbnail images if you so choose.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-12-10 06:14:36 +00:00
westi
944bdb29a6 s/size/s/ fixes #11370 props nacin.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-12-09 09:44:53 +00:00
markjaquith
dc8492b9f5 Introducing set_post_image_size(w, h, crop) so themes can register their special size/crop for canonical post images. WP will create this size/crop upon upload, so your canonical post images fit your space exactly!
git-svn-id: http://svn.automattic.com/wordpress/trunk@12342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-12-08 21:08:19 +00:00
azaozz
fb0d8b44ee Fix image meta after editing image, disable the Save button when no changes, fixes #11115
git-svn-id: http://svn.automattic.com/wordpress/trunk@12163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-11-11 11:24:01 +00:00
azaozz
1c161c23c2 Image editing (first run). Includes code by stephanreiter, see #10528
git-svn-id: http://svn.automattic.com/wordpress/trunk@11911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-09-10 22:07:33 +00:00
azaozz
febbb3bbda Add attachment ID to the wp_generate_attachment_metadata filter, props taco1991, fixes #10494
git-svn-id: http://svn.automattic.com/wordpress/trunk@11747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-07-27 23:08:21 +00:00
azaozz
83f674bf9a Banishing ASCII quotes and apostrophes, props demetris, fixes #9655
git-svn-id: http://svn.automattic.com/wordpress/trunk@11190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-05-05 04:28:05 +00:00
westi
43ba2effcd Allow a plugin to change the jpeg image quality. Fixes #9245 props filosofo.
git-svn-id: http://svn.automattic.com/wordpress/trunk@10682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-02 21:55:40 +00:00
ryan
e89192b1a8 Strip trailing whitespace
git-svn-id: http://svn.automattic.com/wordpress/trunk@10150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-12-09 18:03:31 +00:00
azaozz
01e981dfdb Fix thumbnails creation for 8bpp and CMYK images, props DD32, fixes #7039 fixes #8231
git-svn-id: http://svn.automattic.com/wordpress/trunk@9727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-11-15 23:16:36 +00:00
ryan
9ce46d3937 phpdoc for wp-admin. Props jacobsantos. see #7527
git-svn-id: http://svn.automattic.com/wordpress/trunk@9119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-10-10 18:21:16 +00:00
ryan
5fd146865b phpdoc for wp-admin/includes from jacobsantos. see #7527
git-svn-id: http://svn.automattic.com/wordpress/trunk@9053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-10-02 01:03:26 +00:00
ryan
e3f6b2b271 phpdoc for wp-admin/includes from jacobsantos. see #7527
git-svn-id: http://svn.automattic.com/wordpress/trunk@8912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-09-17 00:40:10 +00:00
ryan
2c92ac6f0b Thumbnail and exif fixes from DD32. see #7622
git-svn-id: http://svn.automattic.com/wordpress/trunk@8879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-09-13 18:04:20 +00:00
ryan
9b02e29a7b Make attachment file path relative to the upload dir. Don't use GUID to find attachement URL. Props DD32. see #7622
git-svn-id: http://svn.automattic.com/wordpress/trunk@8796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-09-02 22:55:39 +00:00
westi
748aac2e3d utf8 encode data from IPTC tags. Fixes #7495 for trunk props Txanny.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-27 06:54:48 +00:00
ryan
ff7b8ffe1b Separate Large and Full image sizes. Props tellyworth. fixes #7151
git-svn-id: http://svn.automattic.com/wordpress/trunk@8612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-11 03:54:26 +00:00
ryan
35b18e5034 Trailing whitespace cleanup
git-svn-id: http://svn.automattic.com/wordpress/trunk@8600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-09 05:36:14 +00:00
ryan
47c6ee0e09 Suppress exif_read_data() errors. Props tellyworth. fixes #6571 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 20:19:15 +00:00
ryan
ba90d16134 Use is_numeric instead of ctype_digit. Props josephscott. fixes #5481
git-svn-id: http://svn.automattic.com/wordpress/trunk@7549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-27 16:56:56 +00:00
matt
bb22054028 Creating intermediate sizes, better thumbnails, and other image improvements. Hat tip: tellyworth.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-03 04:17:37 +00:00
ryan
de3ab9a05e image_resize() and friends from tellyworth. fixes #6005
git-svn-id: http://svn.automattic.com/wordpress/trunk@7041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-02-26 18:46:03 +00:00
ryan
833447d59e Image size options from tellyworth. fixes #5933
git-svn-id: http://svn.automattic.com/wordpress/trunk@6952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-02-21 06:00:15 +00:00
matt
3b82a74e29 Blow out mem limit, slightly larger thumbnails.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-02-11 09:02:44 +00:00
ryan
b5aefdfc0c Use absint
git-svn-id: http://svn.automattic.com/wordpress/trunk@6784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-02-11 08:14:01 +00:00
matt
f55e3feab2 Lowercase extensions too, dynamically change when we try to create thumbnails by memory limit.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-02-11 08:02:01 +00:00
ryan
d88983793b Trailing whitespace cleanup
git-svn-id: http://svn.automattic.com/wordpress/trunk@6726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-02-05 06:47:27 +00:00
ryan
3388050bf9 New image uploader from tellyworth. see #5609
git-svn-id: http://svn.automattic.com/wordpress/trunk@6579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-01-09 08:14:29 +00:00
matt
2073c22bbd Post screen improvements^H^H^H, er, changes. Will file tickets for todos.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-01-03 08:03:29 +00:00
westi
19471ad3ab Fix funky formatting
git-svn-id: http://svn.automattic.com/wordpress/trunk@6454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-12-21 09:23:59 +00:00
westi
92c4835150 Preserve PNG transparency/alpha during thumbnail creation. Fixes #2805 props Libertus/Otto42.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-12-20 22:24:39 +00:00
westi
71b2207ea3 Ensure we don't call exif_read_data() on unsupported file types. Fixes #5397 props DD32
git-svn-id: http://svn.automattic.com/wordpress/trunk@6438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-12-20 22:18:28 +00:00
ryan
2283075a92 Remove unused variables. Props DD32. see #5418
git-svn-id: http://svn.automattic.com/wordpress/trunk@6363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-12-06 06:37:30 +00:00
ryan
dd29614f60 Extract and save image metadata. Props tellyworth. fixes #5162
git-svn-id: http://svn.automattic.com/wordpress/trunk@6313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-11-05 00:01:26 +00:00
westi
3d04ae4f29 Refactor of wp-admin/includes/image.php. Fixes #5312, #4151, #4709, #5304 props DD32.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-11-03 18:33:19 +00:00
ryan
2f09416258 Trim empty lines. Nothing but newline.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 02:25:30 +00:00
ryan
770613e763 Admin includes reorg. see #4334
git-svn-id: http://svn.automattic.com/wordpress/trunk@5542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 07:16:21 +00:00