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.
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]