Skip to content

FastImage finds the dimensions or filetype of an image given its uri by fetching as little as needed

Notifications You must be signed in to change notification settings

gnought/fastimage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FastImage

FastImage finds the dimensions or filetype of a remote image file given its uri by fetching as little as needed, based on the excellent Ruby implementation by Stephen Sykes.

This version was forked from Tom Moor PHP port, and introduced a few changes:

  • usage of exceptions
  • ability to customize HTTP headers
  • namespaced, composer-ready

Usage

<?php 
		
require 'Fastimage.php';
		
$uri = "http://farm9.staticflickr.com/8151/7357346052_54b8944f23_b.jpg";
		
// loading by creating an instance and use the 'load' method
$image = new FastImage();
$image->load($uri);
$type = $image->getType();
echo "filetype: " . $type;

References

License

FastImage is released under the MIT license. It is simple and easy to understand and places almost no restrictions on what you can do with the software. More Information

About

FastImage finds the dimensions or filetype of an image given its uri by fetching as little as needed

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%