306 posts
  • Has been part of the Envato Community for over 2 years
  • Sells items exclusively on Envato Market
crossroad says

Awesome. Thanks for the great work :)

316 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 3 years
+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?

262 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Won a competition
  • Has been part of the Envato Community for over 5 years
+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
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Won a competition
  • Made it to the Authors' Hall of Fame
+13 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?

158 posts ThemeTon
  • Elite Author: Sold more than $75,000 on Envato Market
  • Won a Most Wanted contest
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
+8 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.

194 posts responsive
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has referred 200+ members
+6 more
ZERGE says

Probably try it in the next project.

262 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Won a competition
  • Has been part of the Envato Community for over 5 years
+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
  • Has been part of the Envato Community for over 2 years
  • Sells items exclusively on Envato Market
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.

306 posts
  • Has been part of the Envato Community for over 2 years
  • Sells items exclusively on Envato Market
crossroad says

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

1290 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+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. ;)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by