313 posts
  • 3 Years of Membership
  • Exclusive Author
crossroad
says

Awesome. Thanks for the great work :)

316 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • 4 Years of Membership
+2 more
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?

263 posts
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
  • Winner
+6 more
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
  • Top Monthly Author
  • Weekly Top Seller
  • Power Elite Author
  • Author Level 12
+15 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?

196 posts ThemeTon
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
  • Most Wanted Winner
+10 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.

217 posts responsive
  • Elite Author
  • Trendsetter
  • Exclusive Author
  • Featured Author
+7 more
ZERGE
says

Probably try it in the next project.

263 posts
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
  • Winner
+6 more
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
  • 3 Years of Membership
  • Exclusive Author
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.

313 posts
  • 3 Years of Membership
  • Exclusive Author
crossroad
says

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

1368 posts
  • Weekly Top Seller
  • 5 Years of Membership
  • Author Level 6
  • Beta Tester
+5 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