Fixed widht -> AUTO heigt...

Hello,

I am working on designing a product page (a list)
This includes an image …
Because the image ‘path’ comes from a database,
will often not have the same height and width than I have in mind!

How do I enter a fixed value for the width,
which the height is automatically adjusted.

<?php
while($row = mysql_fetch_row($result))
   {
	$path = $row[0];
	echo " verpakking : $verpakking / eenheid : $eenheid ;
   }
?>

Thankx in in advance…

Do you mean you want to re-calculate height, based on given width to keep image aspect ratio? You need to know image’s actual dimensions (if you do not store this in the database, you can use getimagesize() function). The code is simple:
[php]$height = (int) $fixed_width * $actual_height / $actual_width;[/php]

Thankx this is exacly what i need

Sponsor our Newsletter | Privacy Policy | Terms of Service