PDA

View Full Version : Could someone troubleshoot this script for me?


Deanna475
03-24-2003, 02:25 AM
I found this script at a JS resource site, so right off the bat, I didn't write it, but it's got a bug in it somewhere and I need someone more knowledgeable in the ways of JS than I am to help me figure it out.

The purpose of the script is to allow a user to preview their own graphic from their hard drive in place of the one already on the page. Whoever scripted this maybe left a few things out like having the new image's width and height adjust so that you see the image for what it is, not all squished or blown out of proportion from the dimensions of the image before it. Sometimes it does that. Sometimes it doesn't. Beats the heck outta me why, but otherwise, it does work and do what it's supposed to do.

A working example of this script in action can be found on the following test page:

http://www.theinspirationgallery.com/composer/image_replacement.htm

Any and all advice, feedback, input or suggestions is appreciated.

D.

glenngv
03-24-2003, 02:35 AM
hi, it's you again :) it works for me...

Deanna475
03-24-2003, 02:56 AM
Yeah, it's me again. *S* I'm working on another surprise for my partner. *S* The script works fine for me too ..... until you start applying images with different heights and widths and even then it appears to be random. I can find no pattern as to which images will be "warped" or which will display at the correct dimensions.

Here are two examples that illustrate what I mean (they just both happen to be round GIFs, but it can happen to any graphic of any size:

http://theinspirationgallery.com/composer/Image6.jpg

http://theinspirationgallery.com/composer/Image7.jpg

I thought maybe something had been omitted from the script that auto detects the image's size and displays it accordingly. *Then* the user can change the width or height of the image using the arrows.

What do you think, Glenn?

D.