# Loading unknown JPEG with standard size

**URL:** https://forum.kirupa.com/t/loading-unknown-jpeg-with-standard-size/120361
**Category:** Uncategorized
**Created:** [August 23, 2004, 6:53pm UTC](https://forum.kirupa.com/t/loading-unknown-jpeg-with-standard-size/120361 "2004-08-23T18:53:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kakosworld](https://avatars.discourse-cdn.com/v4/letter/k/6de8d8/32.png) [@kakosworld](https://forum.kirupa.com/u/kakosworld)
#### Post date: [August 23, 2004, 6:53pm UTC](https://forum.kirupa.com/t/loading-unknown-jpeg-with-standard-size/120361/1 "2004-08-23T18:53:49Z")

</div>

Hi you all!

I made a guestbook formular for my website and would like that the visitors have the possibility to insert a photo in it.  
The problem is, that I don´t know the picture’s size the user want to upload. How can I show it in a standard size in my guestbook.

I though in this possibility:  
[font=Courier New]  
_//“photo” is the movie target -\> it contains just a shape_  
_// “filename” is a variable with the filename String_  
\_root.photo.loadMovie(filename);  
var new\_width = getProperty(\_root.photo,\_width);  
var new\_height= getProperty(\_root.photo,\_height);

_//try to find the new scale factor for both axis_ 😕  
_// I want a pic with 150 x 200 pixels_  
while((new\_width \> 200) || (new\_height \> 150))  
{  
scale = scale - 1;  
new\_width = new\_width \* scale / 100;  
new\_height = new\_height \* scale / 100;  
}

// then try to resize the movie, but it doesn´t work :eek:  
setProperty(\_root.photo,\_xscale,scale);  
setProperty(\_root.photo,\_yscale,scale);[/font]

So, I hope somebody can help me in this case… I really don´t have any idea, what could be the problem in this code…

Thanx!
