I’ve been beta testing WordPress 3.5 for a little while now and am building a photo-centric website that will launch after 3.5 is released. So, I’ve been paying particular attention to the media management in 3.5 as it’s been overhauled. I won’t claim to have nailed down the best way of doing things yet, but here are some things that I’m working toward right now.
WordPress media management now has a preference for using ImageMagick if it’s available on the server. If ImageMagick is not available, WordPress will fallback to GD library but it looks like it will only throw an error if neither library is available. So essentially if you want to use ImageMagick instead of GD for resizing images, you’ll need to install and test that it’s working serverside until someone decides to write an admin plugin that will tell WP admins that their server doesn’t have ImageMagick installed.
There is no WordPress UI (yet) for configuring the plethora of options available in ImageMagick, so by default WordPress is simply using it to resize images. This is still good because ImageMagick does a better job than GD of resizing images without losing quality and it will make it easier for plugin developers to extend.
At the time that I discovered WordPress 3.5 prefers IM, I was designing a commandline backend system to deal with images using both jpegtrans and imagemagick. I may still end up doing that since it might be faster to implement and then I’ll write a plugin for WP when I have more time. What I need the script to do is the following:
- resize images according to defined media breakpoints
- transform large jpegs into progressives and/or webP for Android/Chrome
- strip out unnecessary data
- compress! a lot!
- I want EXIF editing capability; namely I want to strip what’s unnecessary and add back copyright and geo location
- More bells and whistles, but those are the basics
Ideally, we can use the imagemagick library to construct well optimized images for mobile first and responsive designs while simplifying the workflow expected of the clients we’re building websites for. I’m not sure how mod_PageSpeed will interact with images already resized and compressed by ImageMagick. That will have to be a different topic and suite of tests.
I will write more in depth about 3.5 media management in other posts, but in the meantime, here are some resources:
http://core.trac.wordpress.org/ticket/6821 and also look at wp-includes/class-wp-image-editor-imagick.php and wp-includes/class-wp-image-editor.php
coming up …. I’m putting together a test page of images processed by a variety of tools (ImageMagick, jpegtrans, mod_PageSpeed) that I hope to get feedback on. Leave a comment if you think I should add a library to that list.