views:

30

answers:

2

I'm working on some theme options that require cropping an image to the user's specification. I've got the JS interface for image cropping down, but I'm wondering if WordPress has any built in functionality I can tap into to crop and re-save the image using the provided dimensions.

Thank you for any pointers!

+1  A: 

Regardless of Wordpress support for image manipulation, you can always fall back on GD, or one of the other image libraries for PHP.

If Wordpress provides any such facilities, they likely rely on these image libraries being installed anyway.

Dolph
Just came across the function wp_crop_image() on this page: http://phpdoc.wordpress.org/trunk/WordPress/Administration/_wp-admin---includes---image.php.htmlExperimenting with it now. I'm sure you're right that it uses GD, but that's definitely not an issue on any of the environments this is going to be in. Necessary package, IMO.
Gavin
A: 

So the solution was indeed wp_crop_image(), for which there's very little documentation - this was the best information I could find: http://phpdoc.wordpress.org/trunk/WordPress/Administration/_wp-admin---includes---image.php.html

The obvious question, once you start working with it, is *what the hell is '$src_abs'*? I still haven't figured that out.

Gavin