nexuslinkservices/image-size-finder

v1.0.0 2016-09-26 11:25 UTC

This package is not auto-updated.

Last update: 2024-11-09 20:33:51 UTC


README

Extension to get image details with size, height,width and valid flag value by mininum/maxinum size given in configuration.

Latest Version Software License Scrutinizer Code Quality Build Status

Installation

If you use composer, you can add this package by running

composer require galiteintechnologies/image-size-finder

Usage

Set minimum and maximum value in bytes in configuration file. like this

image_size:
    minimum: 100
    maximum: 900

If you do not create configuration file it will from package.

<?php

use ImageSizeFinder\PictureParser;

$pictureParser = new PictureParser();
        
$images = ['https://raw.githubusercontent.com/nexuslinkservices/image-size-finder/master/web/samples/sample_image.png'];
$imageDetails = $pictureParser->fetchSize($images);
        
var_dump($imageDetails[0]);        

Output

array = [
        "url"=> "https://raw.githubusercontent.com/nexuslinkservices/image-size-finder/master/web/samples/sample_image.png",
        "size"=> 82966,
        "height"=> 512,
        "width"=> 512,
        "valid"=> true 
    ];

CONTRIBUTING:

Pull requests are always welcome.