110 posts Too Much is Never Enough
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has referred 100+ members
+3 more
premitheme says

Hi there,

Any body tried to replace timthumb with image_resize() function? What’s its pros / cons. Can we depend on it? and is it has the same timthumb issues (premissions…etc)?

I’m going to try it myself but wanted to see what do you think guys.

Thanks,

379 posts
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has been part of the Envato Community for over 3 years
  • Sells items exclusively on Envato Market
+2 more
kaaz says

Timthumb : resizes on the fly
image_resize() : resizes – server side

1001 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+7 more
purethemes says
110 posts Too Much is Never Enough
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has referred 100+ members
+3 more
premitheme says
purethemes said
vt_resize FTW https://gist.github.com/1367237

Thanks will give it a try

3432 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Volunteer moderator says

Personally I think the best option at this point is WordPress’s built-in resizer. It has its limitations, but it also has a lot of advantages (security, no extra configuration, no need to keep up with the latest version since it’s part of the core). I’m going to save myself the headache of using third party resize scripts in the future :)

110 posts Too Much is Never Enough
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has referred 100+ members
+3 more
premitheme says
sevenspark said
Personally I think the best option at this point is WordPress’s built-in resizer. It has its limitations, but it also has a lot of advantages (security, no extra configuration, no need to keep up with the latest version since it’s part of the core). I’m going to save myself the headache of using third party resize scripts in the future :)

Thank you for such valuable opinion sevenspark! But do you mean image_resize() function? or vt_resize (as it uses wp’s built-in resizer)? Just want to know if anobody has any issues with the built-in function.

The only differeance in results I can see that TimThumb can output the image in bigger size if you want, but wp’s built-in function (and vt_resize) uses the max height/width only. But what about server requests for example?

2002 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says
premitheme said
But what about server requests for example?
Timthumb and similar solutions serve images using php which is just a useless waste of servers resources. WP standard behaviour is to resize once and serve the static image directly via the webserver (apache/nginx/whatever)
30 posts
  • Has been part of the Envato Community for over 3 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
Frenki says
bitfade said
premitheme said
But what about server requests for example?
Timthumb and similar solutions serve images using php which is just a useless waste of servers resources. WP standard behaviour is to resize once and serve the static image directly via the webserver (apache/nginx/whatever)

exactly. Few weeks ago i developed WP site for one company, they didnt want to spend much money so instead of creating theme from scratch i told them to buy some template here and ill just customize it for them. Template was using thimthumb and after 2 days of working, they got email from hosting company that they were using to much server resources and their site got suspended…Even tho they had like 3000 visits. After i checked logs, i saw that timthumb script was using 70% of resources… so i just replaced it with WP image_resize and now images are made once you upload it and served as static.

So if u plan on doing site with much or some traffic, i say go with image_resize.
3432 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Volunteer moderator says
premitheme said
sevenspark said
Personally I think the best option at this point is WordPress’s built-in resizer. It has its limitations, but it also has a lot of advantages (security, no extra configuration, no need to keep up with the latest version since it’s part of the core). I’m going to save myself the headache of using third party resize scripts in the future :)

Thank you for such valuable opinion sevenspark! But do you mean image_resize() function? or vt_resize (as it uses wp’s built-in resizer)? Just want to know if anobody has any issues with the built-in function.

The only differeance in results I can see that TimThumb can output the image in bigger size if you want, but wp’s built-in function (and vt_resize) uses the max height/width only. But what about server requests for example?

Sorry for not being more clear. I’m suggesting using the standard WordPress solution as bitfade described. Basically, the process of defining image sizes using add_image_size and then grabbing the appropriate image size using WordPress’s core functions, like get_the_post_thumbnail.

The downsides are several, but outweighed by the positives in my opinion:

1. You can’t scale the image larger than its original size. (I think if you have to, just let the browser do it).

2. Every image will have a copy in every size, whether it needs it or not (if your size choices are well thought out, I don’t think it’s much of a problem – and server space is less expensive than server processing power).

3. If you add or alter an image size in the future, you’ll need to regenerate those thumbnails with a plugin (a little annoying, hopefully they’ll be add some core functionality to do this in the future).

The positives:

1. You’re using core functionality. That simplifies things.

2. Like bitfade said, you’re processing once and serving static files from the server; that’s more efficient in the long run (and easier on your server).

3. No security holes (to my knowledge – clearly, timthumb has had vulnerabilities exploited in the past).

4. No extra configuration for customers (chmods freak non-tech people out)

5. Functionality is automatically upgraded with Core releases (if you use a third party script, you have to upgrade when they upgrade – dependencies can be bad). Also, you can expect the functionality to continue to work with future releases, whereas third-party scripts may lose compatibility and may or may not continue to be supported.

6. Coding this way would make your theme more compatible with plugins that affect image thumbnails (potentially).

Having worked with WordPress for a while now, my opinion is that diverging from the standard WordPress functionality with third party replacements often creates more problems than it’s worth. Generally, working within the system creates fewer headaches for everyone. :)

Hope that explains it (my opinion) better!

Chris

2002 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says

A nice solution would be to use mod_rewrite: serve if images exists, generate it if not.
downside is, adding rewrite rules can sometime be tricky if buyer already has some of them

another one is to use a custom 404 wordpress page to do the same thing, it doesn’t require mod_rewrite but it returns a 404 header when generating the image.
though, almost all browsers would display it anyway.

by
by
by
by
by
by