Speed up development with full-stack environments for every branch.

Learn More

How to get info about an image using GD library [getimagesize and PHP]

158 Runs 772 Views 145 Copies
Saved

Saved

gtsolutions 373

gtsolutions
published 4 years ago

<?php

/**
 * PHP GD
 * get ino about an image using GD library
 */

//setting div style for nicer display
$divStyle = ' background-color:#E8E8E3;
            padding:10px;
            color:#000;
            font-size:16px;
            width:500px;
            margin:0 auto;';

//get the image size along with few other info
$pictureInfo=getimagesize('images/picture.jpg');
echo '<div style="' . $divStyle . '">
<b><u>This is the array returned by getimagesize() on "images/picture.jpg":</u></b>
<br /><br />
<pre>';
print_r($pictureInfo);
echo '</pre>
    </html>'
?>
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).