Welcome Guest, Not a member yet? Register   Sign In
Creating photo gallery, little help please :-)
#1

[eluser]Christophe28[/eluser]
Hello,

I want to create a photo gallery. I have normal size photos on the server and thumbs. I keep the width and height of the photo in the database (is this smart or better working with getimagesize()?) What I'm trying to define is the image width of the thumb in the browser. When $width > $height the width of the thumb (in browser) has to be 80px, but when $width < $height the width of the thumb (in browser) has to be 54px. But what to do when the uploaded photo is already smaller than 80px, and how to program this?

I'm a beginning programmer and I'm a little stuck here. Can somebody help me please? I also think there has to be a standard way to program this ...

What I have for now =
Code:
if($data->file_width > $data->file_height) {
            $data['img_width'] = 80;
        } elseif($data->file_width < $data->file_height) {
            $data['img_width'] = 54;
        }

Thx for any help in the right direction!

Christophe




Theme © iAndrew 2016 - Forum software by © MyBB