|
|
 |
Re: FN-FORUM db site
date posted 1st November 2001 13:11
Many thanks for this information [and for the time spent writing it] - I
will attempt to use it, 'tho' it may take me a while to really follow it!
Iain
----- Original Message -----
From: "Norman Beresford" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Thursday, November 01, 2001 9:42 AM
Subject: RE: FN-FORUM db site
> Hi Iain
>
> One of the problems we discovered with allowing Lusers to
> update their sites is that they tend to put either incorrectly sized
images
> or images in the wrong format (one client insists on putting .PNGs on his
> front page). Our solution to this problem is a combination of a form based
> upload system and an image component on the server.
>
> To give an example we have one application where clients needed to edit
> images attached to objects. To upload an image the clients use a simple
> form such as this :
>
> encType="multipart/form-data">
>
>
>
>
>
> We assign the value of the hidden field using a querystring from the page
> that links to the form. The form handling page takes the uploaded file
and
> saves it to disk. It then works out the dimensions of the images, resizes
> it to fit within certain dimensions. This is a bit of VBScript using
> ASPImage which we use to do the resizing:
>
> Set Image = Server.CreateObject("AspImage.Image")
> Image.AutoSize = true
> Image.LoadImage(thisFileNamePath)
>
> imgWidth = Image.MaxX
> imgHeight = Image.MaxY
>
> If imgWidth > imgHeight Then
> imgproportion = imgWidth / imgHeight
> newImgHeight = 200 / imgproportion
> newImgWidth = 200
> Else
> If imgWidth < imgHeight Then
> imgproportion = imgHeight / imgWidth
> newImgWidth = 200 / imgproportion
> newImgHeight = 200
> Else
> newImgWidth = 200
> newImgHeight = 200
> End If
> End If
>
> Image.Resize newImgWidth, newImgHeight
>
> Image.FileName = agentBaseDirectory & "htdocsimagesimage" & propertyID
&
> ".jpg"
>
> Image.SaveImage
> Set Image = nothing
>
> This script will give us an image that fits within a 200x200 box. We then
> repeat this to produce a thumbnail and a larger version of the image.
This
> way we can assign the correct image SRC programatically within any page
> produced featuring one of the versions. You could enhance the system by
> either recording the new heights and widths within a db to allow you to
> assign those field values to the tag, or you could use the component
> to ensure that the canvas size was always the same (/me wanders off to do
> the second part!).
>
> I did this for an ASP application, but you could easily do something
similar
> using Image Magik on a *nix machine.
>
> HTH
>
> Norman
>
>
> > -----Original Message-----
> > From: [EMAIL REMOVED]
> > [EMAIL REMOVED] Behalf Of [EMAIL REMOVED]
> > Sent: 01 November 2001 07:34
> > To: [EMAIL REMOVED]
> > Subject: Re: FN-FORUM db site
> >
> >
> > Norman,
> >
> > could you expand on this?
> >
> >
> > Using a forms based interface means that you can control size of images
> > > etc to fit into your established styles (ie the have to upload images
> > > through a form, which allows you to progammatically resize them
> > to produce
> > > thumbnails etc etc). Easy to do in the server side langauge of your
> > choice
> >
> > Iain
> >
>
>
> ===========================================================
>
> TightBriefs.com is now live!!!
>
> Clients post their tightly defined briefs, choose a price
> and freelancers are invited to apply.
>
> All client to freelancer contact is handled by us.
>
> Go To: http://www.tightbriefs.com for more details.
>
> ============================================================
>
> * Free listing for freelancers
> * Free to advertise jobs
> * Free jobs distribution service
> * Free database of 1000 freelancers
>
> Freelancers and Freelance Jobs
> http://www.freelancers.net
>
> To post to the Forum:
> [EMAIL REMOVED]
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> To unsubscribe from the digest please email:
>
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
> To subscribe to the digest for this list or for further information please
visit:
> http://www.freelancers.net/forum.html
>
|
 |
|