Hi,
Does anyone know why pthumb is generating thumbnails on 2 locations for remote images? I have pthumb.ptcache_location set to ‘assets/image-cache-v4’ where the thumbnails are generated, but at the same time they are also generated under ‘assets/components/phpthumbof/cache/remote-images’. In the front-end only the first path is used. I could set pthumb.ptcache_location to the remote path, but I’m not sure if that’s the right approach…
Are you sure that in both locations thumbnails are stored?
I believe assets/components/phpthumbof/cache/remote-images is just the place where the original images are stored (that were downloaded from the remote URLs).
The created thumbnails are then stored in the same place as the thumbnails from local images.
Thanks for having a look at this. I’ve had a second look and they are indeed the original images. The problem is that take up 15GB, while (for me) they are not needed. Is there a way to delete them when the thumbails are generated? Or should I create a custom snippet to make thumbnails directly from the remote image instead of storing them locally as well?
I guess, you could periodically delete all the files in that directory.
The problem seems to be, that the next time the pthumb snippet runs, the remote image file will be downloaded again. So if you have a tag like this [[*image:pthumb=`w=120&h=120`]] on a page, then every time the page is parsed, the remote image file will be downloaded (if it doesn’t exist yet locally).
Why does pThumb need local copies of images? Shouldn’t it download to a temp directory, make the thumbnail, and then delete the temporary image? Otherwise, what’s the point of keeping images on an external server?
I guess it helps if you want to create different thumbnail sizes from the same image, that the remote image only has to be downloaded once and can then be used multiple times.
But I can only guess was the intent was when the code was initially written.
Mate I never had a proper solution for this other than stop using S3 (something I did).
At the end what I think it’s happening is that in order to resize the image phpthumb needs to download it first to work on it, once it’s resized that file is unnecessary I but it will be there for future use (what is stupid because you end using the same space as your images are on the local server, I understand).
I imagine you can create a snippet that delete that images and take care of the images already processed and stored on the cache folder to not delete them or not run the extra unless it is strictly necessary but that is messy.
No solution yet I think, unless you create one!
May be I’m sooo wrong on my opinion, just check you self and let us know!
I only need resizing so I think I’ll go for a custom snippet. Just a quick check if the thumbnail exists and otherwise generate it.
Thanks everyone for having a look at it