bitandblack / image-information
Reading information of images
Fund package maintenance!
Buymeacoffee
Requires
- php: >=8.1
- ext-dom: *
- bitandblack/composer-helper: ^1.0 || ^2.0
- bitandblack/duration: ^1.0
- bitandblack/iccprofile: ^0 || ^1.0
- bitandblack/pathinfo: ^1.0
- psr/cache: ^3.0
Requires (Dev)
- ext-imagick: *
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^11.0
- rector/rector: ^1.0
- symfony/cache: ^6.0 || ^7.0
- symplify/easy-coding-standard: ^12.0
README
Bit&Black ImageInformation
Read information of images:
- The size
- The color profile
Currently supported files and extensions:
ai
Adobe Illustrator Artworkbmp
Windows Bitmapeps
Encapsulated PostScriptgif
Graphics Interchange Formatico
Initial Coin Offeringiff
Interchange File Formatjp2
,jpf
(Extended) JPEG 2000jpg
,jpeg
Joint Photographic Experts Grouppdf
Portable Document Formatpng
Portable Network Graphicspsd
(Adobe) Photoshop Documentsvg
Scalable Vector Graphicstif
,tiff
Tagged Image File Formatwbmp
Wireless Application Protocol Bitmap Formatwebp
Google WebP
Installation
This package is made for the use with Composer. Add it to your project by running $ composer require bitandblack/image-information
.
Usage
Define your file with the File
class. Init the Image
class then and add your file:
<?php
use BitAndBlack\ImageInformation\Image;
use BitAndBlack\ImageInformation\Source\File;
$file = new File('MyFile.eps');
$image = new Image($file);
Access the image size: $image->getSize();
Access the images color profile: $image->getIccProfile();
Cache
You can speed up the library by using a cache. When initializing the image class, add a cache object as second parameter:
<?php
use BitAndBlack\ImageInformation\Cache\Cache;
use BitAndBlack\ImageInformation\Image;
use BitAndBlack\ImageInformation\Source\File;
$file = new File('MyFile.eps');
$image = new Image($file, new Cache());
Per default, the cache class uses a file system cache. This can be configured as only a PSR cache compatible class is needed.
Help
If you have questions feel free to contact us under hello@bitandblack.com
.
Further information about Bit&Black can be found under www.bitandblack.com.