Author |
Topic |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 19 March 2003 : 12:48:47
|
I have an image upload MOD installed.
What I want to do is find a script that will determine the height and width dimensions and then output them in text for the member to see. It would be really nice if the script (or another) could determine the dimensions of the file to be uploaded "before" it was uploaded.
What I mean is that after the user selects which file to upload, a confirmation would display the file's statistics as in image KB size, image dimensions, etc.
I want the one script to help the user determine which uploaded file to use in their posts and the other script to help the user to determine which file to upload from their computer.
Thanks so much,
Etymon
|
|
DavidRhodes
Senior Member
United Kingdom
1222 Posts |
Posted - 19 March 2003 : 16:43:24
|
You can't do this before upload as the server must read the file properties in order to get the size etc. |
The UK MkIVs Forum |
|
|
Deleted
deleted
4116 Posts |
Posted - 19 March 2003 : 17:30:37
|
That can be done via a client size Java application (I don't know Java unfortunately). |
Stop the WAR! |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 19 March 2003 : 19:45:44
|
quote: Originally posted by DavidRhodes
You can't do this before upload as the server must read the file properties in order to get the size etc.
sure it can I have a dhtml script I've used to do client side processing of image sizes.
http://hafresno.org/development/imgSize.htm |
|
|
|
Deleted
deleted
4116 Posts |
Posted - 19 March 2003 : 20:43:59
|
OK, you can do it . But a couple things are worth to mention (comments are welcome):
- The width and height properties do not work on some NS & Opera versions and they return 0.
- The parameters show the rendered width & height (as far as I know), so you have to use the image tag without these tags, so it may render out of the window if it is large. You would like to put a form and a button to start the upload there, and pass the measured values to ASP. You may also want to disable the button until the image is fully loaded.
- A bit loosely related, but you cannot get the filesize (which may be more important in an upload application)
- It will not work with JS challenged users.
Thanks for the code
|
Stop the WAR! |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 20 March 2003 : 11:00:38
|
yeah, I failed to mention a few caveats. |
|
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 20 March 2003 : 12:29:47
|
Thanks everyone for the input and for the code, dayve!
What about "after" the image is on my server? Is there a way of determining the height and width and then displaying it to the user?
Thanks again,
Etymon
|
|
|
ROB
Junior Member
USA
347 Posts |
Posted - 20 March 2003 : 18:30:57
|
If your host will consider installing a new component, check out Active BitMapSize II. It will check the pixel dimensions and color depth of the image after uploading (and it's FREE).
The downside to doing the check after uploading is that, well, it's done after the upload (and the time to upload and bandwidth consumed, etc.). But it does work. You could limit the size, return an error if it's too big or whatever... then just delete the uploaded file. |
Jeff (ROB) Hester BigBlueNetwork | BigBlueBall | Christian Church Today |
|
|
|
Topic |
|