is there an option to save the huge image?

25 views
Skip to first unread message

AndyPSV

unread,
Jan 18, 2011, 3:00:17 PM1/18/11
to Smart Lencioni Image Resizer
User uploads huge image -> I want to first create "normal" thumbnail,
eg 550px width and I want to store only this image to reduce the
traffic on the website and overall page speed.

Then from this image I want to create "images" which are "on the fly",
cached and stored in VARIOUS folders (best them to be stored in the
folders where are the original files).

Is it possible? How parameters I need to use to achieve it? Or I need
to add extra code?

I didn't found it on: http://code.google.com/p/smart-lencioni-image-resizer/wiki/Usage
can I use relative patches eg. http://mysite.com/i/ to files?

AndyPSV

unread,
Jan 19, 2011, 8:16:29 AM1/19/11
to Smart Lencioni Image Resizer
I want to do with the usage of your script. Is there an option to
actually do that *(specify folder name in fly, to create it in "x"
directory)?

Joe Lencioni

unread,
Jan 19, 2011, 9:32:34 AM1/19/11
to smart-lencioni...@googlegroups.com
If I understand you correctly, no SLIR will not do this.

However, SLIR will cache each image it renders, so it only needs to render it one time.

AndyPSV

unread,
Jan 19, 2011, 9:37:59 AM1/19/11
to Smart Lencioni Image Resizer
is there an option to put "save" option of the image in SLIR? can you
do it?
I want to have only 1 script which would be used in the whole process
of image creating

Joe Lencioni

unread,
Jan 19, 2011, 9:45:42 AM1/19/11
to smart-lencioni...@googlegroups.com
I don't think I completely understand what you are asking. Could you give me an example scenario?

AndyPSV

unread,
Jan 19, 2011, 11:04:34 AM1/19/11
to Smart Lencioni Image Resizer
User visits my website and uploads huge (resolution) image -> I want
to first create "normal" version of it, max height: 720px; width:
720px (same as facebook images)
and I want to store only this image to reduce the traffic on the
website and overall page speed.

I would like to use slir for this purpose to don't write (use) more
scripts for this purpose.

So it would be great to have an option to make slir create it for me
and write to to directory I want to write this image.

For Ex. for calling (inside the script):
http://localhost/libs/slir/w720-h720-save:i|16|1|my_picture.jpg

would save it (put) to: /i/16/1/my_picture.jpg directory.

You understand now?
Could you construct such option?

"|" <- could replace: "/"

Joe Lencioni

unread,
Jan 19, 2011, 11:14:48 AM1/19/11
to smart-lencioni...@googlegroups.com
I think you don't quite understand how SLIR works. Doing something like this won't reduce traffic on the website at all and will only speed up your pages for the first time they are loaded (because the image isn't in SLIR's cache). You simply use the special SLIR URL for your images, and then this is roughly what happens in SLIR:
  1. SLIR checks to see if the request URI is in the request cache, if it is, it simply outputs that image
  2. SLIR then computes the requested parameters and checks to see if the rendered image is in the rendered cache, if it is, it simply outputs that image
  3. If nothing is in the cache, this is the first time this particular transformation has been requested, so SLIR applies the requested transformations to the source image (resizing, cropping, sharpening)
  4. SLIR then saves this rendered version in its rendered cache and creates a symlink to the rendered cache in the request cache.
  5. SLIR then outputs the rendered image
So, all you need to do is store the uploaded images in a spot where SLIR can access them and then point your image URLs at SLIR and tell SLIR where to find the image. All of the resizing and caching happens on the fly.

Does that clarify things at all, or do I still not understand?

AndyPSV

unread,
Jan 19, 2011, 11:18:01 AM1/19/11
to Smart Lencioni Image Resizer
Yes, I understand what SLIR is, it's very good script, but
I wanted just to use it to create (resize) some images and good option
would be to put save feature in the script.

Otherwise I would need to use separate script. When I have a library I
like it to have everything I need.

Thanks for your great work.

On Jan 19, 5:14 pm, Joe Lencioni <joe.lenci...@gmail.com> wrote:
> I think you don't quite understand how SLIR works. Doing something like this
> won't reduce traffic on the website at all and will only speed up your pages
> for the first time they are loaded (because the image isn't in SLIR's
> cache). You simply use the special SLIR URL for your images, and then this
> is roughly what happens in SLIR:
>
>    1. SLIR checks to see if the request URI is in the request cache, if it
>    is, it simply outputs that image
>    2. SLIR then computes the requested parameters and checks to see if the
>    rendered image is in the rendered cache, if it is, it simply outputs that
>    image
>    3. If nothing is in the cache, this is the first time this particular
>    transformation has been requested, so SLIR applies the requested
>    transformations to the source image (resizing, cropping, sharpening)
>    4. SLIR then saves this rendered version in its rendered cache and
>    creates a symlink to the rendered cache in the request cache.
>    5. SLIR then outputs the rendered image

AndyPSV

unread,
Jan 19, 2011, 11:19:05 AM1/19/11
to Smart Lencioni Image Resizer
I wanted to save those huge resolution images and left only on server
those who are resized to h-720 and w-720 (as max values), that's all
(to use your library for this purpose)

AndyPSV

unread,
Jan 19, 2011, 11:42:36 AM1/19/11
to Smart Lencioni Image Resizer
I fully understand what slir is and I've understood your point of
view.

The reason why this option should be available in a such great project
(it's only a couple of lines, slir even don't cathes the image) is
that when you're creating a website which would visit millions of
users you need to save maximally space at the disc.
Imagine now that you've got image 2MB; swirl does the "usual" image
cache, next 1MB on the server (50% more than it should be).

That's the reason this option should be available. I would write it if
you won't or order somebody to make it. Yes, I can use another script
too, but I would like to have all in one package.

Thanks.

I'm working on a huge service for which I would get lots of money (but
not for doing it to somebody, but through selling shares) and
everything needs to be perfect. My works include.
http://cocaincorp.com/
http://path-of-power.com/
http://chcur.cocaincorp.com/investor

and I would be thankful if you would supply this feature. Thanks
Reply all
Reply to author
Forward
0 new messages