PHP code example of farmani / remote-image-info
1. Go to this page and download the library: Download farmani/remote-image-info library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
farmani / remote-image-info example snippets
"http://farm9.staticflickr.com/8151/7357346052_54b8944f23_b.jpg";
// loading image into constructor
$image = new RemoteImageInfo($uri);
if($image->checkLoad()) {
list($width, $height) = $image->getSize();
echo "dimensions: " . $width . "x" . $height;
}
// or, create an instance and use the 'load' method
$image = new RemoteImageInfo();
$image->load($uri);
if($image->checkLoad()) {
$type = $image->getType();
echo "filetype: " . $type;
}