I don't know much about image processing and formats, but the physical file
size has no relationship to the width/height of am image. Image formats
contain extra information such as color indexes or extra metadata that adds
additional information. In addition, most web formats allow for loosy
compress which mean that some information is lost. Different files can have
different compression thresholds.
If you wanted to limit the upload size (in bytes) there is a size limit that
you can impose on ASP.NET so that huge files are not uploaded. This is
something that can be set in the web.config or machine.config. If you want
to limit the width/height of an image, you will need to look at the contents
of the file. If you know the format, the less processor intensive method
might be to open the uploaded file in a stream and locate the appropriate
bytes that identify this information. If you do not know the format well,
you can always load the stream into an Image object and use the
methods/properties available.
"Jensen bredal" <je***********@ mimosa.com> wrote in message
news:uD******** ******@TK2MSFTN GP09.phx.gbl...
Well that were i'm very confused. I thought there was
a linear relation between the two parameter you mentioned.
But my knowledge is really weak in this area.
Assume the size is 3000000 bytes and the type is"filetype /JPEG". Does
this relate
to a unique (width , heigt) pair?
I assume a 50 k maximum size should be allowable.
What does it correspong to in terme of size(bytes)?
Does this depend on weather "JPEG" or "GIF"?
"Peter Rilling" <pe***@nospam.r illing.net> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. When you say "size", do you mean the width and height, or the phsyical
file size?
"Jensen bredal" <je***********@ mimosa.com> wrote in message
news:el******** ********@TK2MSF TNGP09.phx.gbl. ..
Hello gurus
I need to upload to accept image upload on my site. I also need to
display these images in a databound control.
The image are upload in a database.
My concers are:
-How do i enforce size limit on image?(which size is acceptable?)
I'm thinking of using a custum validator and validate the image for a
certain size.
Any comment will be higly appreciated.
Many thanks in advance