Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Defining the size of intermediate pictures.  (Read 9966 times)

0 Members and 1 Guest are viewing this topic.

xplicit

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 214
Defining the size of intermediate pictures.
« 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..?
« Last Edit: July 16, 2006, 12:06:00 pm by GauGau »
Logged
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Defining the size of intermediate pictures.
« Reply #1 on: July 16, 2006, 01:38:55 am »

Use the PHP getimagesize function.

http://us2.php.net/function.getimagesize
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

xplicit

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 214
Re: Defining the size of intermediate pictures.
« Reply #2 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 :)

Logged
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

xplicit

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 214
Re: Defining the size of intermediate pictures.
« Reply #3 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 :)
Logged
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.