{"id":16413945,"url":"https://github.com/willwashburn/fasterimage","last_synced_at":"2025-04-07T06:08:07.265Z","repository":{"id":31616947,"uuid":"35181988","full_name":"willwashburn/fasterimage","owner":"willwashburn","description":":racehorse: find the size of an image without downloading the whole file. Supports batch requests.","archived":false,"fork":false,"pushed_at":"2019-05-25T14:35:30.000Z","size":75,"stargazers_count":62,"open_issues_count":1,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T04:07:57.356Z","etag":null,"topics":["image","image-analysis","image-size","php","size"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willwashburn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-06T20:45:29.000Z","updated_at":"2025-03-27T17:01:12.000Z","dependencies_parsed_at":"2022-08-21T08:40:44.773Z","dependency_job_id":null,"html_url":"https://github.com/willwashburn/fasterimage","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwashburn%2Ffasterimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwashburn%2Ffasterimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwashburn%2Ffasterimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwashburn%2Ffasterimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willwashburn","download_url":"https://codeload.github.com/willwashburn/fasterimage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image","image-analysis","image-size","php","size"],"created_at":"2024-10-11T06:52:49.147Z","updated_at":"2025-04-07T06:08:07.238Z","avatar_url":"https://github.com/willwashburn.png","language":"PHP","readme":"# FasterImage [![CircleCI](https://img.shields.io/circleci/project/github/willwashburn/fasterimage.svg?style=flat-square)](https://circleci.com/gh/willwashburn/fasterimage) [![Coveralls](https://img.shields.io/coveralls/willwashburn/fasterimage.svg?maxAge=259200\u0026style=flat-square)](https://coveralls.io/github/willwashburn/fasterimage) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.4-8892BF.svg?style=flat-square)](https://php.net/) [![Packagist Version](https://img.shields.io/packagist/v/fasterimage/fasterimage.svg?style=flat-square)](https://packagist.org/packages/fasterimage/fasterimage) [![Packagist Downloads](https://img.shields.io/packagist/dt/fasterimage/fasterimage.svg?style=flat-square)](https://packagist.org/packages/fasterimage/fasterimage/stats) [![License](https://img.shields.io/packagist/l/fasterimage/fasterimage.svg?style=flat-square)](https://github.com/willwashburn/fasterimage/LICENSE)\n\nFasterImage 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](https://github.com/sdsykes/fastimage) and [PHP implementation by Tom Moor](https://github.com/tommoor/fastimage).\n\nFasterImage uses the curl_muli* suite to run requests in parallel. Currently supports JPG, GIF, PNG, WEBP, BMP, PSD, TIFF, SVG, and ICO files.\n\n## Usage\n```php\n\n        $client = new \\FasterImage\\FasterImage();\n        \n        $images = $client-\u003ebatch([\n            'http://wwww.example.com/image1.jpg',\n            'http://wwww.example.com/image2.gif',\n            'http://wwww.example.com/image3.png',\n            'http://wwww.example.com/image4.bmp',\n            'http://wwww.example.com/image5.tiff',\n            'http://wwww.example.com/image6.psd',\n            'http://wwww.example.com/image7.webp',\n            'http://wwww.example.com/image8.ico',\n            'http://wwww.example.com/image9.cur',\n            'http://wwww.example.com/image10.svg'\n        ]);\n        \n        foreach ($images as $image) {\n            list($width,$height) = $image['size'];\n        }\n```\n\n## Install\n\n```composer require fasterimage/fasterimage```\n\nAlternatively, add ```\"fasterimage/fasterimage\": \"~1.5\"``` to your composer.json\n\n## Changelog\n\n* v1.5.0 - Fallback support when curl_multi_init() is not available\n* v1.4.0 - Add support for parsing dimensions from SVG images\n* v1.3.0 - Add ability for user agent, buffer size, and SSL host/peer verification to be overridden\n* v1.2.1 - Limit isRotated to only check for valid orientation values\n* v1.2.0 - Add option to include content-length in result set\n* v1.1.2 - Update Accept header to accept images\n* v1.1.1 - Properly handle jpeg's with corrupted Exif tags \n* v1.1.0 - Return message in return array when curl fails\n* v1.0.3 - Use external stream package\n* v1.0.2 - Fail invalid image exceptions gracefully when using batch requests\n* v1.0.1 - Support PHP v5.4+\n* v1.0.0 - **Stable Release** - Support for `.PSD`, `.ICO` + `.CUR`\n* v0.0.7 - Remove support for PHP v5.4\n* 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\n* v0.0.5 - Support for `.webp`\n* v0.0.4 - Support for `.tiff` and exceptions for unknown file types\n* v0.0.3 - Force curl to follow redirects so you get less bad responses\n* v0.0.2 - Update curl headers to mimic browser so you get less bad responses\n* v0.0.1 - Support for `.jpg`, `.bmp`, `.gif`, `.png` and parallel requests\n\n## References\n\n* https://github.com/sdsykes/fastimage\n* https://github.com/tommoor/fastimage\n* http://pennysmalls.com/find-jpeg-dimensions-fast-in-pure-ruby-no-ima\n* http://snippets.dzone.com/posts/show/805\n* http://www.anttikupila.com/flash/getting-jpg-dimensions-with-as3-without-loading-the-entire-file/\n* http://imagesize.rubyforge.org/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillwashburn%2Ffasterimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillwashburn%2Ffasterimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillwashburn%2Ffasterimage/lists"}