3

I wonder if its a good idea to use add_image_size or is it just a convinence feature. I say this as I think add_image_size creates images of various sizes regardless of what the usage if the image maybe

eg. I may want a thumbnail of 500x200 in my portfolio pages only. but WordPress will create images of 500x200 for all images I upload right? If I have a bunch of add_image_size, it will clutter up my uploads with useless images I will never use? Is there a better solution? Resize before upload, maybe alittle troublesome?

1
  • Old question, new comment, random thought: would it be possible to block other size creation based in post type?
    – brasofilo
    Commented Jun 1, 2012 at 23:39

2 Answers 2

1

For image formats that are only used for a small fraction of the images, I suggest using an on-the-fly image resizer. Preferrably one that caches the images so that you only have to resize them once. I use TimThumb for a number of projects, and it's been good enough for me.

1
2

Yes, an alternative will be to use Timthumb, which will resize images on the fly but will require some additional processing power. It does have a cache but with a large site, I believe that it will face its cache limits too.

Personally I would just keep my uploads organized in years/months folder and let it create as many copies as I want. This way, there is no additional load on the server for serving images. Because with Timthumb its not a static element anymore. And uploads are just increasing your uploads size which is really not much of a big deal, now is it?

2
  • 1
    The cache limits is the disk space, and it will use less disk space than if you resized ALL images using add_image_size. So I still think timthumb is a viable option. But I agreee on the processing power, there is a significant overhead for images not in the cache.
    – windyjonas
    Commented Apr 18, 2011 at 14:27
  • What about the lookup in a directory flooded with insane number of files? Moreover cache usage will also require I/O lookups if the file already exists and all. IMO its still better to organize uploads in months folder and then let WordPress create multiple copies.
    – Ashfame
    Commented Apr 18, 2011 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.