forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: xplicit on July 16, 2006, 01:25:57 am

Title: Defining the size of intermediate pictures.
Post by: xplicit on July 16, 2006, 01:25:57 am
Hello I've stumbled into a problem and I did several things to programm it but can't get it working...

Here's the thing. I want to set the intermediate pictures as a background in a table and cover the table with a transparent gif image. So far so good and it's working. But..... to get if fully working I have to know the intermediate picture size otherwise the table will schrink to a 1 pixel height image.

Normally the intermediate picture itself just streched the table with the needed not hardcoded width and height to fit but now the picture is in the background so it wont strech... and the size is now the size of the transparant gif...

It there a trick I can use to determine the intermediate file dimensions? the most dificutl part is the height... how can i determine that..?
Title: Re: Defining the size of intermediate pictures.
Post by: kegobeer on July 16, 2006, 01:38:55 am
Use the PHP getimagesize function.

http://us2.php.net/function.getimagesize
Title: Re: Defining the size of intermediate pictures.
Post by: xplicit on July 16, 2006, 01:47:18 am
Thanx for your very quick and helpfull response!!!

I think that can precisely do wath I want :)

Will programm further and let you know how it worked out :)

Title: Re: Defining the size of intermediate pictures.
Post by: xplicit on July 16, 2006, 04:13:11 am
Ok Fixed it :)

Probably not the shortest code but well it's working :)

Code: [Select]
$hostserver  = $_SERVER['HTTP_HOST'];
$_REAL_SCRIPT_DIR = realpath(dirname($_SERVER['SCRIPT_FILENAME']));
$_REAL_BASE_DIR = realpath(dirname(__FILE__));
$_MY_PATH_PART = substr( $_REAL_SCRIPT_DIR, strlen($_REAL_BASE_DIR));
$pathpart = $_MY_PATH_PART ? substr( dirname($_SERVER['SCRIPT_NAME']), 0, -strlen($_MY_PATH_PART) ) : dirname($_SERVER['SCRIPT_NAME']);
$prefixserver = "http://";
$samen = "/".$picture_url;
$adresnaarfoto  = $prefixserver.$hostserver.$pathpart.$samen;
$sizer  = getimagesize($adresnaarfoto);
$intermediatesize = $sizer['3'];

Thnx for the support!

If somebody knows a shorter version  to get to the same result please let me know. But for know I'm off to bed :)