# Photogallery+thumbnail tutorial related

**URL:** <https://forum.kirupa.com/t/photogallery-thumbnail-tutorial-related/221634>\
**Category:** Uncategorized\
**Created:** [April 5, 2007, 7:55pm UTC](https://forum.kirupa.com/t/photogallery-thumbnail-tutorial-related/221634 "2007-04-05T19:55:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maninderv](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@maninderv](https://forum.kirupa.com/u/maninderv)\
**Post date:** [April 5, 2007, 7:55pm UTC](https://forum.kirupa.com/t/photogallery-thumbnail-tutorial-related/221634/1 "2007-04-05T19:55:08Z")

</div>

Hi Everyone,

I have a question regarding the photogallery tutorial on this site.

Currently, all tutorials related to it (including adding of thumbnails) is written in such a manner that they assume all photos would be of equal size ie 300x200.

However, I do not have any such luxory and am stuck as I am not able to get it to work here.

The code is more or less related to the following -

We are doing a picture.loadMovie() to load the external jpeg.

Now, how do we make sure it’s always in the center and has maxWidth as 300 and maxHeight as 200? ie, if width \> 300 then width = 300 and height = proportionate to 200  
and so on?

I am not able to capture the height and width of the “picture”

It keeps coming as 0.

Please help.

Thanks,  
Mandy.

function nextImage() {  
if (p\<(total-1)) {  
p++;  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
picture\_num();  
}  
}  
}

this.onEnterFrame = function() {  
filesize = picture.getBytesTotal();  
loaded = picture.getBytesLoaded();  
preloader.\_visible = true;  
if (loaded != filesize) {  
preloader.preload\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
preloader.\_visible = false;  
if (picture.\_alpha\<100) {  
picture.\_alpha += 10;  
}  
}  
};
