CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Image resizing by upload

Print topic Send  topic

Author Message
wilco_wings


Posts: 11
Posted: 12/04/2004, 1:44 AM

Hi,

For this project I use a server with the Persist ASPUpload & ASPJpeg components installed on it. I know how to make a normal upload.

But how can I resize the images?

I need the following to get work... A record form with 3 upload controlls on it, where the user can select 3 images. Image 1 needs to be stored 2 times, one as thumbnail and one normal resized image 320x240.

Does anyone have an idea how to do this?
View profile  Send private message
DonB
Posted: 12/04/2004, 5:26 AM

You will need to look for a 3rd party addin. One that comes to mind is
AspImage. Any of these will likely be a problem for your hosting service
(if indeed that's your situation). Like this one, they are all likely to be
ActiveX DLLs that must be registered on the server for them to work.

Your best bet is probably to consider moving to PHP. I found it easy to
make the leap.

--
DonB

http://www.gotodon.com/ccbth


"wilco_wings" <wilco_wings@forum.codecharge> wrote in message
news:641b18708ba25e@news.codecharge.com...
> Hi,
>
> For this project I use a server with the Persist ASPUpload & ASPJpeg
components
> installed on it. I know how to make a normal upload.
>
> But how can I resize the images?
>
> I need the following to get work... A record form with 3 upload controlls
on
> it, where the user can select 3 images. Image 1 needs to be stored 2
times, one
> as thumbnail and one normal resized image 320x240.
>
> Does anyone have an idea how to do this?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

GeorgeS

Posts: 206
Posted: 12/04/2004, 6:27 PM

Yes, in PHP many things are done much easier and I like it very much but if your server already has Persist ASPUpload & ASPJpeg components installed why not to use them?
There is no need for AspImage - ASPJpeg can do the same.
Here is what I do on one of the upload pages to resize & save a small thumb of uploaded JPG using ASPJpeg:

Function NewRecord1_FileUpload1_AfterProcessFile()

'Custom Code @17-73254650
' -------------------------
if NewRecord1.FileUpload1.value <> "" then
dim Jpeg, f_path, L
f_path = Server.MapPath("uploaded_pics/") & "\"

Set Jpeg = Server.CreateObject("Persits.Jpeg")

' Open source image
Jpeg.Open f_path & NewRecord1.FileUpload1.value

' New width
L = 100

' Resize, preserve aspect ratio

Jpeg.Height = L

Jpeg.Width = Jpeg.OriginalWidth * L/Jpeg.OriginalHeight

' create thumbnail and save it to disk
Jpeg.Save f_path & "thumbs\" & NewRecord1.FileUpload1.value

end if
======================================


BTW, I couldn't get Persist ASPUpload component to work in my CCS project because my Hosting company does not support UPLOAD.SAVE method and I just used PureASP upload instead.


_________________
GeorgeS
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.