4 replies [Last post]
xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Was this information Helpful?

Hi all,

I have a couple of products that use the same image. When I add an image to the product, imagecache creates a duplicate image with _0, _1, _2 for each duplicate. This works, but it seems a bit wasteful to have users downloading these duplicate images.

Is there an easy way to get imagecache / Ubercart to use the same image for multiple products?

Thanks!
Xerxes

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Product images

Unfortunately, there isn't right now. I had heard about a new CCK field that would let you choose an image already on the server or upload a new one, but I don't think anyone's actually released it yet.

If it really bothers you, you can change the values in the content_field_image_cache table so that multiple rows use the same fid. This points to a row in the files table that stores the path to the image file. Not the best solution, I know, but at least it looks better than putting <img> tags in the node body.

xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Re: Re: Product images

Ok, thanks for the idea. That will work for now. I'll keep my eyes out for that new CCK field...

oslinux's picture
Offline
Joined: 09/06/2007
Juice: 461
Re: Product images

so we are talking about speed for the user's browser, right? You do not want the very same image to be downlaoded multiple times! I do not exactly know how imagecache works, maybe you you would alter its database that all points to the same file and then the browser should only request it once...

Francois's picture
Offline
Joined: 08/19/2008
Juice: 387
What Lyle said

I think that's what Lyle was saying

--------
'Twas the end of the world, and you didn't even know it.