PHP Classes

PHP Image cURL: Emulate getimagesize function remotely using cURL

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-06-08 (11 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 490 All time: 5,444 This week: 1,359Up
Version License PHP version Categories  
image-curl 1.0.1Custom (specified...5.4PHP 5, Graphics, Files and Folders, W...
Description Author  

This class can emulate getimagesize function remotely using cURL.

It can retrieve an image file from a remote server using the cURL extension to send HTTP requests to that server.

The class implements a function that works like the original PHP getimagesize, except that it works for getting the image size and image type metadata of images retrieved from remote servers where fopen wrappers are disabled in the PHP configuration.

Besides the original getimagesize function metadata, it also returns the image file size.

Innovation Award  
PHP Programming Innovation award nominee
May 2014
Number 2

Prize: One copy of the Zend Studio
The getimagesize function is very useful to get the dimensions of images read from local or remote files.

However, if the fopen wrappers are disabled in the current PHP configuration, getimagesize cannot get the dimensions of remote images.

This class implements an alternative solution that relies only on the cURL extension.

Manuel Lemos
Picture of Mike Jordan
Name: Mike Jordan <contact>
Classes: 5 packages by
Country: United States United States
Age: 52
All time rank: 1693225 in United States United States
Week rank: 1560 Up172 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file img_info.php Class Image class to simulate the getimagesize function
Accessible without login Plain text file license.txt Lic. zlib/libpng License
Accessible without login Plain text file readme.txt Data Class Information
Accessible without login Plain text file test_img_info.php Example Demo script

 Version Control Reuses Unique User Downloads Download Rankings  
 0%1Total:490All time:5,444
 This week:0This week:1,359Up