292 posts
  • Exclusive Author
  • Has been a member for 2-3 years
crossroad says

Awesome. Thanks for the great work :)

315 posts
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
  • Attended a Community Meetup
  • Exclusive Author
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
SyamilMJ says

Hi,

I saw on line 43/44 that you’re querying the db for attachment id, so you can update the metadata with the new resized image dimensions later? Would it be a problem if for example, the author would like to provide a custom input field for e.g. slider, meta box, where users may freely insert whatever size for the image instead of the original URL?

252 posts
  • Elite Author
  • Won a Competition
  • Has been a member for 5-6 years
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
der says

Hi, I saw on line 43/44 that you’re querying the db for attachment id, so you can update the metadata with the new resized image dimensions later? Would it be a problem if for example, the author would like to provide a custom input field for e.g. slider, meta box, where users may freely insert whatever size for the image instead of the original URL?

The script only alters the metadata of the resized images (line 269). This means you can set any metadata you want to the attachment, and it wouldn’t interfere. The metadata is then used to automatically remove the generated thumbnails when you remove the original image from the media library.

Also, you can use the script to just create the image without echoing the resulting url, useful if you want to only ensure the thumbnail is created for later use.

922 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Most Wanted Bounty Winner
  • Bought between 500 and 999 items
  • Referred between 500 and 999 users
  • Interviewed on the Envato Notes blog
  • Envato Studio (Microlancer) Beta Tester
  • Won a Competition
+8 more
MDNW says

This looks pretty awesome – just to be thorough, here’s another script that I’ve been using for a while now that works without any major hitches…

VT_Resize Source: https://gist.github.com/seedprod/1367237 And a quick little patch that I’ve been using since the image_resize deprecation: http://www.munto.net/blog/2013/01/22/vt_resize-php-image_resize-deprecated/

Thanks for sharing yours Der! I’ve gotta dig into it a bit deeper, but I really love seeing author contributed stuff, so a huge thumbsup to you :)

Any chance you’ve run across the vt_resize script and had issues/thoughts on it?

147 posts ThemeTon
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Has been a member for 3-4 years
  • Bought between 100 and 499 items
  • Exclusive Author
  • Referred between 50 and 99 users
+1 more
themeton says

Very interesting. I like it doesn’t require any permission and configs. Thank you for sharing it and I’ll try it out here.

189 posts responsive
  • Elite Author
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Europe
  • Sold between 250 000 and 1 000 000 dollars
  • Bought between 50 and 99 items
  • Referred between 200 and 499 users
  • Has been a member for 3-4 years
+1 more
ZERGE says

Probably try it in the next project.

252 posts
  • Elite Author
  • Won a Competition
  • Has been a member for 5-6 years
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
der says

Hey guys, glad you like it. I’m currently using the script in my themes and so far it’s been very smooth. If I find an issue I’ll update the code immediately, so you guys can also have the fixes. It’s intended to be a collaborative thing. If you find an issue, feel free to send a pull request on Github.

@MDNW Brandon, thanks for the thumbs up! I haven’t used that plugin before but it seems nice. I’ll try it out later on and see how it goes…

107 posts
  • Exclusive Author
  • Has been a member for 1-2 years
mailmilisku says

Look like another great script,

I’m little confuse (sorry, I’m not experience in php) about the code you give:

// Put this in your functions.php function theme_thumb($url, $width, $height=0, $align='') { return mr_image_resize($url, $width, $height, true, $align, false); } $thumb = theme_thumb($image_url, 800, 600, 'br'); // Crops from bottom right echo $thumb;

That’s all code place on function.php?
How to call inside the loop?
Really appreciate if you make sample basic code like Aqua on Github.
Thanks.

292 posts
  • Exclusive Author
  • Has been a member for 2-3 years
crossroad says

This script uses depreciated functions (eg. wp_load_image), so TF won’t approve it.

1068 posts
  • Forum Superstar
  • Most Wanted Bounty Winner
  • Envato Studio (Microlancer) Beta Tester
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 50 and 99 users
  • Europe
  • Has been a member for 3-4 years
  • Exclusive Author
+1 more
Smartik says

This script uses depreciated functions (eg. wp_load_image), so TF won’t approve it.

Deprecated since 3.5.0. It’s OK, but you can “fork” the author on github, for example to replace wp_load_image() with wp_get_image_editor() and send a pull request. This is why Github exists. ;)

by
by
by
by
by
by