bitandblack / image-information
Reading information of images
Fund package maintenance!
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 || ^2.0
- psr/cache: ^3.0
Requires (Dev)
- ext-imagick: *
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: ^2.0
- symfony/cache: ^6.0 || ^7.0 || ^8.0
- symplify/easy-coding-standard: ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Bit&Black Image Information
Read information of images:
- The size
- The color profile
Currently supported files and extensions:
aiAdobe Illustrator ArtworkaniAnimated CursoravifAV1 Image File FormatbmpWindows BitmapcurCursorddsDirectDraw SurfaceepsEncapsulated PostScriptexrOpenEXRgifGraphics Interchange FormathdrRadiance HDRheic,heifHigh Efficiency Image ContainericoInitial Coin OfferingiffInterchange File FormatjngJPEG Network Graphicsjp2,jpf(Extended) JPEG 2000jpg,jpegJoint Photographic Experts GroupjxlJPEG XLjxrJPEG XRmngMultiple-image Network GraphicspcxPCXpdfPortable Document FormatpngPortable Network Graphicspsd(Adobe) Photoshop DocumentqoiQuite OK Image Formatsvg,svgzScalable Vector GraphicstgaTruevision TGAtif,tiffTagged Image File FormatwbmpWireless Application Protocol Bitmap FormatwebpGoogle 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.