Page 1 of 1
CGSmartImage: Name of the cached image file
Posted: Mon Aug 25, 2014 2:49 pm
by urheat
I have a site and I need to access images that are cached with CGSmartImage.
How the file name of the cached image is created? . Like, how do I know that when the original image is named for examle image.jpg and it's cached version is image named
If it is meant to be a secret, I need to find an another way

Re: CGSmartImage: Name of the cached image file
Posted: Mon Aug 25, 2014 7:00 pm
by velden
My first question would be: "Why do you need to know that?".
The original filename is in the src param of the module en the resulting filename is in the output of it.
Re: CGSmartImage: Name of the cached image file
Posted: Mon Aug 25, 2014 7:08 pm
by calguy1000
The output filename is a hash of all of the parameters and data used to generate the image.... if you change the preferences, or change the parameters in the tag, or even change the order of some of the parameters then the file name can be different. There is no (reasonable) way to guess what the output filename will be. However, if you call CGSI exactly the same way 2 times for the same image, it should generate the same filename. If the file by that name already exists, it is not regenerated and the cached copy is used.
CGSmartImage is designed to do 'on display' image processing, there are options to output merely the filename, or the entire 'img' tag. There should be no need to know the algorithm used to generate the filename.
Re: CGSmartImage: Name of the cached image file
Posted: Mon Aug 25, 2014 7:40 pm
by urheat
Thanks for the answers. I have a website that consists of three different areas. Two of those areas are made with CMSMS but the third is so static that I don't want (or need to use CMSMS). But the problem is, that I need some pictures of the other CMSMS installations. So I think there can be a reasonable need

Re: CGSmartImage: Name of the cached image file
Posted: Tue Aug 26, 2014 7:26 am
by velden
urheat wrote:So I think there can be a reasonable need

I don't agree.
First of all I don't think it's 'fair' to expect a module to serve you while not using it's framework (static pages instead of cmsms).
Then, when those pages are static, how hard would it be to just link to the images in the cache directory of CGSmartImage? The images need to be processed by CGSmartImage (hence cmsms) first of course.
Or consider uploading those static images in the right format.
Or consider using CMSMS for those 'static pages'.
Re: CGSmartImage: Name of the cached image file
Posted: Tue Aug 26, 2014 10:43 am
by urheat
I just told you why I need the file names, 'cause you asked

Because it's not possible to get it, I have to think some other ways.
I'll think that I make a cron job that makes smaller images using GD and use those images for my purposes.
Thanks!
Re: CGSmartImage: Name of the cached image file
Posted: Tue Aug 26, 2014 11:02 am
by velden
What I don't understand is when it's a static page, why do you need to change the image sizes? Do the images change? (which would make it less static then)
Re: CGSmartImage: Name of the cached image file
Posted: Tue Aug 26, 2014 11:07 am
by urheat
velden wrote:What I don't understand is when it's a static page, why do you need to change the image sizes? Do the images change? (which would make it less static then)
In this case I mean "the static" means that the content doesn't change so often that it would be wise to use CMS. And the images from the CMSMS sites are shown automatically and randomly. They are like banners.
Re: CGSmartImage: Name of the cached image file
Posted: Tue Aug 26, 2014 11:13 am
by velden
I see.
Well note that linking the images from CGSmartImage is not really harder than linking other images. Though the filenames are less obvious, they will not change when you do not change the module call of CGSmartImage (not sure about future upgrades of the module).
So once you link those it will work wouldn't it?
Re: CGSmartImage: Name of the cached image file
Posted: Tue Aug 26, 2014 1:03 pm
by Jo Morg
urheat wrote:velden wrote:What I don't understand is when it's a static page, why do you need to change the image sizes? Do the images change? (which would make it less static then)
In this case I mean "the static" means that the content doesn't change so often that it would be wise to use CMS.
Well, I don't know about the wise part, but cached pages are equal to static pages in performance. So I think you are complicating a simple thing. My 2 cents.
Re: CGSmartImage: Name of the cached image file
Posted: Tue Aug 26, 2014 2:36 pm
by urheat
This conversation is developing quite interesting

If I don't use CMSMS, I don't have to update the system and it is cheaper to develop.