Fork me on GitHub! Get free lemonade!
Download .zip Download .tar.gz View on GitHub

Based on the idea of Aqua Resizer from Syamil MJ -- Thanks

Description

This small script will allow you to resize & crop WordPress images uploaded via the media uploader. It relies on WP's native functions to resize the images, and checks if there is an already resized version of the image so that it won't be wasting your server's resources to regenerate the images.

Why use it?

There are a couple of image resizing scripts out there that already have this function. Some authors simply use the add_image_size() function to define custom image sizes that will be generated for each image uploaded via the media uploader. I mostly find these methods somewhat a little complicated to use, or having some limitations or too resource intensive.

With Aqua Resizer, the only required inputs are the URL and width. It's easy, fast & efficient. Additionally, you have the additional options such as the height, crop, and array return.


How to use

You can use the solution as WordPress plugin or include the functions in your WordPress theme.

As Plugin

Install the plugin and activate in backend. After activation you can use all functions.

In your theme

Include the the file with follow syntax in your functions.php of your theme and now you can also use the functions.

require_once( 'aq_resizer.php' );

Now you can use the different functions.

The follow is only an small example, you find more functions, possibilities and examples of source on the wiki to this repository You can then use it in your theme as such:

Echo img-tag

$args = array( 'url' => 'your img url', 'width' => 'your wish for width' );
wp_img_resizer( $args );

Return single value or array with url, width, height

$args = array( 'url' => 'your img url', 'width' => 'your wish for width' );
wp_img_resizer_src( $args );

Shortcode for an gallery

[resizer_gallery width='120']

Also the first solution if Aqua Resizer

aq_resize( $img_url, $width );

Documentation

More usage instructions and examples can be found in our wiki


Installation

Requirements

Installation


Other Notes

Disclaimer

I'm German and my English might be gruesome here and there. So please be patient with me and let me know of typos or grammatical farts. Thanks

Contact & Feedback

The plugin is designed and developed by (Frank Bültge) based on the idea from Syamil MJ

Please let me know if you like the plugin or you hate it or whatever ... Please fork it, add an issue for ideas and bugs.

License

Good news, this plugin is free for everyone! Since it's released under the GPL, you can use it free of charge on your personal or commercial blog. But if you enjoy this plugin, you can thank me and leave a small donation for the time I've spent writing and supporting this plugin. And I really don't want to know how many hours of my life this plugin has already eaten ;)


Changelog