I have looked at this code till my eyes pop and can't see what's wrong.
The php code below to return image height works fine on my local XAMPP server but when moved to the shared isp hosting does not return any values. Same with the code to return IPTC Caption.
I conclude that getimagesize and or iptcparse are not running, but why?
I've checked and checked.
Any ideas about what areas to investigate would be very welcome 🙁
CODE:
if (empty($GET['photo']))
{echo "<img src='/rand/rand_image.pl' alt='featured image' /> "; // } On first display of page, start with a random image of known height
}
else {
$imageName= "images/asia/{$GET['photo']}";
echo "<img src='$imageName' alt='' /> "; //otherwise display image corresponding to selected thumbnail
}
?>
<?php
list($width, $height) = getimagesize("$imageName");
echo "Height of selected image= ";
echo "$height";
echo "<BR>";
?>
<div id="caption">
<?php
$size = getimagesize ("$imageName",&$info);
$iptc = iptcparse ($info["APP13"]);
if (isset($info["APP13"])) {
$iptc = iptcparse($info["APP13"]);
if (is_array($iptc)) {
$caption = $iptc["2#120"][0];
echo "Caption = " .$caption;
}}
echo "<BR>";
?>