aboustayyef / image-extractor
takes a url or HTML and returns the largest image
Installs: 42
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/aboustayyef/image-extractor
Requires
Requires (Dev)
- phpspec/phpspec: 2.2.*
This package is not auto-updated.
Last update: 2025-10-01 15:36:38 UTC
README
#Image Extractor
This class extracts an image from a url. supports open graph images, img tags and Youtube embed previews (in that order)
##Usage
<?php
use Aboustayyef\ImageExtractor;
$imageExtractor = new ImageExtractor('http://url.goes/here');
$img = $imageExtractor->get(300); // Where 300 here is the minimum width accepted for an image
?>
##Disqalifying Image
<?php
use Aboustayyef\ImageExtractor;
$imageExtractor = new ImageExtractor('http://url.goes/here');
$img->disqualify('http://image.to/disqualify.jpg');
$img = $imageExtractor->get(300); // resulting image will not include disqualified image
?>