Hi, I am trying the new 2.5.4 version of Image Sizer, and having a problem. It is only caching the first image out of each folder. So, for instance, I am using it for a staff directory and I just get one headshot (the first one I view) for everyone. It is caching the images without a file name–”-120x180.jpg”–which I assume is the problem.
It works perfectly with version 2.1. Any idea what the problem could be? I tried setting the base_cache manually, with no effect.
My template debugging output, if it helps:
(0.145299) Tag: {exp:imgsizer:size src="http://www.domain.com/assets/headshots/name.gif" width="198"}
(0.146223) No Closing Tag
(0.146374) Processing Tags
(0.146443) Plugin Tag: Imgsizer/size
(0.146474) Including Files for Tag and Modules
(0.150382) Beginning Final Tag Data Processing
(0.150437) Calling Class/Method: Imgsizer/size
(0.150657) -> Class Called: Imgsizer
(0.150823) -> Method Called: size
(0.150934) <img src="http://www.domain.com/assets/headshots/name.gif" alt="" />
(0.150988) /var/www/html/domain/
(0.151063) urlarray path //assets/headshots/name.gif
(0.152092) -> Data Returned
(0.152208) - End Tag Processing -
Sorry, should have clarified: all instances of “name.gif” are the actual file name. That is, the one that I am passing to Image Sizer, not the image that is actually displayed. I will also pm you the actual output in a second.
Edit: It looks like your mailbox is full & I can’t PM you.
Lumis (David),
I changed the base path, but I still noticed it appended a /images/uploads suffix into my designated cache folder and was wondering if it’s possible to change that? I know it’s by design and is likely based on the information from the upload directory it uses, but just curious. I was hoping it would go directly into the folder I specified rather than creating a few more subfolders. It’s not a big deal, but just wanted to know.
And might I say, thanks for the contribution after such a long period! =)
@Adam I am working with EliVZ to find out what that problem is. However any help or information you can provide would be cool, can you PM me your template debug output and php version? I have a idea of what it is but i want to be sure.
@Danny, I did it that way so there are no file-name collisions. if the cache folder was one big folder and you had your originals like this
/images/uploads/sunset.jpg and /images/member_uploads/sunset.jpg
when the plug-in re-sized them and put them all in one folder the most recently re-sized version would overwrite the older one if they are set to the same sizing.
The other option i did not do and it may really be a better option. Would be to md5 hash the image name and path and create the cached image from that. the downfall to that is the image names would be ugly and not very friendly for things like “seo - google images etc.”
The benefit for setting base_path yourself is that you could use this with cache_path to fetch images outside of your web-root and then cache them into your web-root. e.g. if you had multiple domains and wanted to share a single image repository across domains.
That’s precisely what I’m trying to do. Can you explain further? Do I need to do anything special in imagesizer for the site where the originals are? And in the other site where I’m retrieving them, do I need both the base_path and cache_path parameters?
ok give version 2.5.5 a try (Thanks all for sending your debug info)
also added 2 remote fetch options remote_user= (optional) use if the remote server requires a username and password. remote_pass= (optional) use if the remote server requires a username and password.
@Adam I have some work to take care of now i will try and get you an example a bit latter.
ok give version 2.5.5 a try (Thanks all for sending your debug info) also added 2 remote fetch options remote_user= (optional) use if the remote server requires a username and password. remote_pass= (optional) use if the remote server requires a username and password. @Adam I have some work to take care of now i will try and get you an example a bit latter.
Excellent stuff, works for me! Look forward to your explanation of the cross-site method.
Thank you again.
The benefit for setting base_path yourself is that you could use this with cache_path to fetch images outside of your web-root and then cache them into your web-root. e.g. if you had multiple domains and wanted to share a single image repository across domains.That’s precisely what I’m trying to do. Can you explain further?
Figured it out as much as I needed to. Since my two sites are on the same server, I see that I don’t need the base_cache parameter, only the base_path when calling from the site where the images are not located. Then, in that imagesizer tag’s src, I just precede the {sized} variable with the domain name of the site where the images are located. Great!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.