Thumbnails
by JJ on 11/1/2007 9:44:00 AM
I have a gallery-like application. (The gallery will be actually presented
in Flash, but the management (cms) of the images will be in asp.net. )
My question is, is it ok to create Thumbnail images on the fly by resizing
the original sending it to the output stream (i.e. Response.ContentType =
"image/jpeg"; Response.BinaryWrite(imageContent) ), or best to actually save
the thumbnails to disk.
Would this method result in a much slower displaying of thumbnails?
Keep in mind that several thumbnails will be displayed on one page (in
flash, but not sure if thats relevent).
I am trying to avoid the headache of saving thumbnails and managing their
deletion etc.
JJ
Re: Thumbnails
by Eliyahu Goldin on 11/1/2007 2:02:00 PM
I can't see how sending to the output stream can be slower than rendering
files. When you point url to a file, someone on the server site will need to
open the file an put the content in the http response.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"JJ" <abc@xyz.com> wrote in message
news:e9ZRnvGHIHA.3956@TK2MSFTNGP04.phx.gbl...
>I have a gallery-like application. (The gallery will be actually presented
>in Flash, but the management (cms) of the images will be in asp.net. )
>
> My question is, is it ok to create Thumbnail images on the fly by resizing
> the original sending it to the output stream (i.e. Response.ContentType =
> "image/jpeg"; Response.BinaryWrite(imageContent) ), or best to actually
> save the thumbnails to disk.
>
> Would this method result in a much slower displaying of thumbnails?
>
> Keep in mind that several thumbnails will be displayed on one page (in
> flash, but not sure if thats relevent).
>
> I am trying to avoid the headache of saving thumbnails and managing their
> deletion etc.
>
> JJ
>
Re: Thumbnails
by Mark Rae [MVP] on 11/1/2007 10:30:00 AM
"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@mMvVpPsS.org> wrote in
message news:eaGnF5GHIHA.1208@TK2MSFTNGP03.phx.gbl...
>I can't see how sending to the output stream can be slower than rendering
>files. When you point url to a file, someone on the server site will need
>to open the file an put the content in the http response.
I believe the OP was asking whether the extra overhead in creating the
thumbnails on the fly as and when they are needed would be significant
enough to make it worth actually storing the thumbnails themselves as
separate JPEGs on the server's file system, especially since Flash is
involved...
I'm afraid I don't know the answer...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: Thumbnails
by JJ on 11/1/2007 10:41:00 AM
I guess I am comparing the creation of a (high quality) thumbnail each time,
against opening a pre-created file of the same size.
I don't _think_ the flash will change things here. It could just as well be
a browser accessing the files. Flash will just be given the urls (whether
that is a handler url or an actual file url is the question). It sounds as
though there isn't any obvious rule saying that using one or the other is
much slower...
A handler removes the headache of trying to manage thumbnails, but would it
be ok to server say 40 images to a single web page. I would have thought so,
but wonder if there is a bottleneck of any sorts here?
JJ
"Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message
news:OGwpfIHHIHA.6044@TK2MSFTNGP04.phx.gbl...
> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@mMvVpPsS.org> wrote in
> message news:eaGnF5GHIHA.1208@TK2MSFTNGP03.phx.gbl...
>
>>I can't see how sending to the output stream can be slower than rendering
>>files. When you point url to a file, someone on the server site will need
>>to open the file an put the content in the http response.
>
> I believe the OP was asking whether the extra overhead in creating the
> thumbnails on the fly as and when they are needed would be significant
> enough to make it worth actually storing the thumbnails themselves as
> separate JPEGs on the server's file system, especially since Flash is
> involved...
>
> I'm afraid I don't know the answer...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: Thumbnails
by Dave Bush on 11/1/2007 3:34:00 AM
You could server side cache the results and reduce the number of times
you actually create the thumbs. But, there will be a performance hit
(although I doubt anyone will really see it) when it does create the
thumb.
-----Original Message-----
From: JJ [mailto:abc@xyz.com]
Posted At: Thursday, November 01, 2007 5:44 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Thumbnails
Subject: Thumbnails
I have a gallery-like application. (The gallery will be actually
presented
in Flash, but the management (cms) of the images will be in asp.net. )
My question is, is it ok to create Thumbnail images on the fly by
resizing
the original sending it to the output stream (i.e. Response.ContentType
=
"image/jpeg"; Response.BinaryWrite(imageContent) ), or best to actually
save
the thumbnails to disk.
Would this method result in a much slower displaying of thumbnails?
Keep in mind that several thumbnails will be displayed on one page (in
flash, but not sure if thats relevent).
I am trying to avoid the headache of saving thumbnails and managing
their
deletion etc.
JJ
Re: Thumbnails
by Lloyd Sheen on 11/1/2007 5:24:00 AM
"JJ" <abc@xyz.com> wrote in message
news:e9ZRnvGHIHA.3956@TK2MSFTNGP04.phx.gbl...
>I have a gallery-like application. (The gallery will be actually presented
>in Flash, but the management (cms) of the images will be in asp.net. )
>
> My question is, is it ok to create Thumbnail images on the fly by resizing
> the original sending it to the output stream (i.e. Response.ContentType =
> "image/jpeg"; Response.BinaryWrite(imageContent) ), or best to actually
> save the thumbnails to disk.
>
> Would this method result in a much slower displaying of thumbnails?
>
> Keep in mind that several thumbnails will be displayed on one page (in
> flash, but not sure if thats relevent).
>
> I am trying to avoid the headache of saving thumbnails and managing their
> deletion etc.
>
> JJ
>
I did an app which allowed browsing of a folder of subfolders of images.
The pages presented showed dynamically created thumbnails.
The app would check to see if a subfolder named thumbs existed and if not
would then create the folder and required thumbnails on the go. If the
subfolder existed it would only create thumbnails for those files which were
new and did not have corresponding thumbnails. All the overhead of creating
the folder, the thumbnails was only noticed when a user would ask for a page
size of 20 to 30. Numbers under that were not noticable and number above
that were slow enough that the overhead was not a factor.
LS