Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to generate resized images on the fly. Basically I'm creating a plugin that allows the user to set a default image that gets displayed on the front end. He also has an option to change the size of this image anytime via the plugin options.

So what would be the best way to resize his uploaded image and display it on the front-end? How can I implement that?

Is it right to say that WordPress does not have a simple function to resize images on the fly (with caching)? That's all I need, nothing more fancy, so if there is something in-built to WordPress I would go ahead and use that.

share|improve this question
1  
closevoted, shopping/plugin recommendation is not an appropriate fit for this site – Tom J Nowell Feb 12 at 12:17
Five answers an no one explains how to do it, just link rot. :( – toscho Feb 12 at 12:45
@toscho If so, go and downvote. – kaiser Feb 12 at 12:51
Jetpack Photon will do it automatically for you, no coding needed (so I don't know why it's downvoted) – birgire Feb 12 at 12:51
3  
@userabuser We want to collect canonical answers: working solutions, not links. – toscho Feb 12 at 13:23
show 2 more comments

closed as off topic by Tom J Nowell, kaiser, s_ha_dum, Brian Fegter, EAMann Feb 12 at 16:45

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

5 Answers

Also try,

http://matthewruddy.github.com/Wordpress-Timthumb-alternative/

I've been using this regularly of recent.

Usage:

$url = 'http://domain.com/path/to/image1.png';              // Required
$width = 300;                                               // Optional. Defaults to '150'
$height = 200;                                              // Optional. Defaults to '150'
$crop = true;                                               // Optional. Defaults to 'true'
$retina = false;                                            // Optional. Defaults to 'false'

// Call the resizing function (returns an array)
$image = matthewruddy_image_resize( $url, $width, $height, $crop, $retina );

// Outputs resized image URL, http://yourwordpressdomain.com/wp-content/uploads/01/image1-300x200.png
echo $image['url'];
share|improve this answer
Another good candidate, now how to choose between this one and WP Thumb... – drtanz Feb 12 at 13:44

Try my script: BFI Thumb It's similar to Aqua Resizer, with a few Timthumb capabilities (colorize/tint, negate, grayscale) tied in. The script uses WP's Image Editor to perform resizing. It can also upscale images, similar to Timthumb's capabilities. It also saves a local copy of the image so it won't need to process it again.

share|improve this answer

Try WP-Thumb

http://wordpress.org/extend/plugins/wp-thumb/

http://hmn.md/introducing-wp-thumb/

It integrates into the WordPress APIs so you're not relying on timthumb or alternatives that have fundamentally flawed designs, and you're using standard APIs, with some additional features

share|improve this answer
Very interesting, this seems like a great candidate for what I need to do. – drtanz Feb 12 at 13:41

I found this one: Aqua Resizer, what the script do is generating resized version of the image, but it won't generate the image with same size the 2nd time if it's has been generated before.

share|improve this answer

WP.com Photon API:

Photon is an image acceleration and modification service for Jetpack-connected WordPress sites. Converted images are cached automatically and served from the WordPress.com CDN.

Images can be cropped, resized, and filtered by using a simple API controlled by GET query arguments. When Photon is enabled in Jetpack, images are updated on the fly.

We want to create the best image manipulation and acceleration service in the world for WordPress users

http://developer.wordpress.com/docs/photon/

With the Jetpack plugin install and Photon installed, it will do the resizing automatically.

Here is an overview of the API:

http://developer.wordpress.com/docs/photon/api/

Here is an example using the fit parameter:

http://i0.wp.com/s.ma.tt/files/2010/10/MCM_4049.jpg?fit=300,300

You should definitely consider using this great free service.

share|improve this answer
Thanks but I'd rather not rely on Jetpack, not all users will have it installed. – drtanz Feb 12 at 13:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.