@coxdabd posted a new topic, subject "Getimagesize Problem". It read:

   Hi all, I think it's only a minor problem but the getimagesize function doesn't appear to be working in my script. The images are indeed echoing out but without any width and height attributes. Any ideas what I've done wrong? 
    [code] 
        <?php
        $images = explode(",", $row['workImg']);
        	foreach($images as $value):
        	list($width, $height, $type, $attr) = getimagesize($value);
        	echo "<img src=\\"$value\\" $attr />\
        ";
        	echo $width;
        	endforeach;
        
        ?>
        
    [/code]

So @coxdabd replied

    Ooops it was an issue with the file path in the database. For some reason the function doesn't like the following: /images/example.jpg but instead accepts images/example.jpg. So it doesn't like the leading slash. Removed the slash in the database and instead added the slash to img tag in the echo as below (should any Googler stumble across this)! Thanks anyway 
    [code] 
        <?php
        $images = explode(",", $row['workImg']);
        	foreach($images as $value):
        	list($width, $height, $type, $attr) = getimagesize($value);
        	echo "<img src=\\"/$value\\" $attr />\
        ";
        	endforeach;
        
        ?>
        
    [/code]

To which @Mandes replied

    The leading slash should take you back to the default root directory, omitting that slash you are looking for a subdirectory of the directory the script is in.


{'source': 'discourse', 'url': 'https://www.sitepoint.com/community/t/getimagesize-problem/78971', 'title': 'Getimagesize Problem', 'views': 502, 'has_accepted_answer': False, 'word_count': 199, 'like_count': 0, 'reply_count': 1, 'participant_count': 2, 'posts': 3, 'tags': '', 'author': '@coxdabd', 'participants': '@coxdabd, @Mandes', 'image_url': [None], 'created_at': '2011-02-27T16:02:39.000Z', 'last_posted_at': '2011-02-27T16:11:48.000Z'}