473,804 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Working with image.


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
Nov 18 '05 #1
6 1439
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

Nov 18 '05 #2
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


Nov 18 '05 #3
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



Nov 18 '05 #4
Well that was great help.

Thank you....


"Peter Rilling" <pe***@nospam.r illing.net> wrote in message
news:Oj******** ******@tk2msftn gp13.phx.gbl...
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
>
>



Nov 18 '05 #5
Checkout this C# Code. Easy to convert to VB if requied

http://www.aspheute.com/english/20001130.as

If you need to resize the image then follow this
There is a Ratio for each image. Suppose they are 800 X 600 then you divide 800 by 600 to get a ratio of 1.3. The only difference is first check which of this is greater & always divide the greater by the smaller value. If you find that the height is greater then reduce the height maybe say 100 px and then reducde the width by this Ratio.

This tip is because you are trying to povide a list to the user. Thumbnails should be easier for your Server to handle

Regards

Trevor Benedict
MCSD
Nov 18 '05 #6
Well those pieces of code really rock.
That was a major help i must admit...

Thank you to you all.

"Trevor Benedict R" <tr********@yah oo.com> wrote in message
news:A6******** *************** ***********@mic rosoft.com...
Checkout this C# Code. Easy to convert to VB if requied.

http://www.aspheute.com/english/20001130.asp

If you need to resize the image then follow this.
There is a Ratio for each image. Suppose they are 800 X 600 then you divide 800 by 600 to get a ratio of 1.3. The only difference is first check
which of this is greater & always divide the greater by the smaller value.
If you find that the height is greater then reduce the height maybe say 100
px and then reducde the width by this Ratio.
This tip is because you are trying to povide a list to the user. Thumbnails should be easier for your Server to handle.
Regards,

Trevor Benedict R
MCSD

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6721
by: Kamyk | last post by:
Hello all! Could you tell me where is the error on the below code, because the script is sometimes working correctly and sometimes is not working correctly. I want my new window with picture to be fitted/enlarged to original size. The page on the below address: http://www.kapy.bydg.pl/~marcinz/stolarnia/. I have Windows XP and IE 6.0. and everything works correctly. If I run the page on Win 2000, IE 5.0.
5
2737
by: Brian | last post by:
Hello all.. Am working on an Air Hockey game... have an table loaded into a picture box. The borders of the table are slightly slanted. Am using hit testing lines with GDI+ to manipulate the puck moving around. I want the puck is bounce when it hits a border (specified by the hitlines). Retreieved some info on hit testing lines from Bob Powell's GDI+ FAQ (very useful!) but i'm fairly new at the idea of hit testing and am
0
1252
by: wschlichtman | last post by:
I am running into speed issues when attempting to work with larger image files, e.g., 5 M/Pixel photos. I have been experimenting with in-memory working images which are scaled down to a more managable size. This seems to work well, taking a GrayScale operation from 1850 milliseconds to about 300, but then I run into problems when I wish to save work that's been done to the image, such as a NoiseRemoval operation. The working file has been...
6
2053
by: pmud | last post by:
Hi, I have created a very simple ASP.NET application which has a couple of ImageButtons which go to different SQL reports on clicking them. I have used Response.Redirect to send the user to the SQL reports. Now after viewing the report when I hit the Baxk Button on my browser. and then I click the image buttons, nothing happens. Any ideas why this is happening?
8
2539
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs file (present under the Properties folder of the project) 3. Now I created a file called test.js on the root folder of the project,
7
3760
imrosie
by: imrosie | last post by:
Hello, I don't completely understand the working of these functions, but it's been suggested that these will give me what I need. I have a database that pulls in image files (stores the absolute path in database). The image shows up in my subform. The file name is displayed in a form control called 'image description'. The problem is it displays the entire link, such as c:\imageCats\GizmotheCat.jpg (absolute path).... End user cah...
10
5234
by: Stephen.Schoenberger | last post by:
Hello, Sorry if this is not "exactly" a C topic but I thought this would be the best place to start. I need some guidance on working with bitmap images in ANSI C. I need to "read" in a bitmap image, then break it up into pieces (say 32x32) then take those pieces and "save" them, granted they do not need to be a readable image, then perform some other operations on the pieces, and then combine the manipulated pieces back into one image.
7
1716
by: Poppy | last post by:
I've put together some code to demonstrate what my goal is though looping pixel by pixel it's rather slow. import Image def check_whitespace(): im = Image.open("\\\\server\\vol\\temp\\image.jpg") size = im.size
3
1701
by: dAttitude | last post by:
hi guys .. my team is working on an application where we have to have one image which is acting as the base of all the elements on the screen ... and this same image has a transparency in the center. now this centre transparency is supposed to display a picture which will be captured from a web cam. currently everything working fine but the only problem which we are facing is that the picture is not proportionate to what is the actual...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.