2017 © Pedro Peláez
 

library fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

image

fasterimage/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  • Thursday, March 29, 2018
  • by willwashburn
  • Repository
  • 5 Watchers
  • 22 Stars
  • 8,412 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 16 Versions
  • 39 % Grown

The README.md

FasterImage CircleCI Coveralls Minimum PHP Version Packagist Version Packagist Downloads License

FasterImage 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 and PHP implementation by Tom Moor., (*1)

FasterImage uses the curl_muli* suite to run requests in parallel. Currently supports JPG, GIF, PNG, WEBP, BMP, PSD, TIFF, SVG, and ICO files., (*2)

Usage


$client = new \FasterImage\FasterImage(); $images = $client->batch([ 'http://wwww.example.com/image1.jpg', 'http://wwww.example.com/image2.gif', 'http://wwww.example.com/image3.png', 'http://wwww.example.com/image4.bmp', 'http://wwww.example.com/image5.tiff', 'http://wwww.example.com/image6.psd', 'http://wwww.example.com/image7.webp', 'http://wwww.example.com/image8.ico', 'http://wwww.example.com/image9.cur', 'http://wwww.example.com/image10.svg' ]); foreach ($images as $image) { list($width,$height) = $image['size']; }

Install

composer require fasterimage/fasterimage, (*3)

Alternatively, add "fasterimage/fasterimage": "~1.5" to your composer.json, (*4)

Changelog

  • v1.5.0 - Fallback support when curl_multi_init() is not available
  • v1.4.0 - Add support for parsing dimensions from SVG images
  • v1.3.0 - Add ability for user agent, buffer size, and SSL host/peer verification to be overridden
  • v1.2.1 - Limit isRotated to only check for valid orientation values
  • v1.2.0 - Add option to include content-length in result set
  • v1.1.2 - Update Accept header to accept images
  • v1.1.1 - Properly handle jpeg's with corrupted Exif tags
  • v1.1.0 - Return message in return array when curl fails
  • v1.0.3 - Use external stream package
  • v1.0.2 - Fail invalid image exceptions gracefully when using batch requests
  • v1.0.1 - Support PHP v5.4+
  • v1.0.0 - Stable Release - Support for .PSD, .ICO + .CUR
  • v0.0.7 - Remove support for PHP v5.4
  • v0.0.6 - Add option to set timeout of requests, support for EXIF in .jpgs, better support for .bmp (including negative height bitmaps) and normalized response indexes for all file types
  • v0.0.5 - Support for .webp
  • v0.0.4 - Support for .tiff and exceptions for unknown file types
  • v0.0.3 - Force curl to follow redirects so you get less bad responses
  • v0.0.2 - Update curl headers to mimic browser so you get less bad responses
  • v0.0.1 - Support for .jpg, .bmp, .gif, .png and parallel requests

References

  • https://github.com/sdsykes/fastimage
  • https://github.com/tommoor/fastimage
  • http://pennysmalls.com/find-jpeg-dimensions-fast-in-pure-ruby-no-ima
  • http://snippets.dzone.com/posts/show/805
  • http://www.anttikupila.com/flash/getting-jpg-dimensions-with-as3-without-loading-the-entire-file/
  • http://imagesize.rubyforge.org/

The Versions

29/03 2018

dev-master

9999999-dev https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

07/03 2018

v1.2.0

1.2.0.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

07/03 2018

v1.1.2

1.1.2.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

04/11 2016

v1.1.1

1.1.1.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

04/11 2016

dev-fix-travis-pls

dev-fix-travis-pls https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

10/04 2016

1.0.3

1.0.3.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

27/08 2015

1.0.2

1.0.2.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

16/05 2015

1.0.1

1.0.1.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

16/05 2015

1.0.0

1.0.0.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

16/05 2015

0.0.7

0.0.7.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

11/05 2015

0.0.6

0.0.6.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

09/05 2015

0.0.5

0.0.5.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

07/05 2015

0.0.4

0.0.4.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

07/05 2015

0.0.3

0.0.3.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

07/05 2015

0.0.2

0.0.2.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage

06/05 2015

0.0.1

0.0.1.0 https://github.com/willwashburn/fasterimage

FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

parallel fastimage image size getimagesize fast image faster image fasterimage