aboustayyef/image-extractor

接受URL或HTML,并返回最大的图片

dev-master 2015-11-01 07:58 UTC

This package is not auto-updated.

Last update: 2024-10-02 10:18:10 UTC


README

#Image Extractor

此类从URL中提取图像。支持开放图图像、img标签和YouTube嵌入预览(按此顺序)

##使用方法

<?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

?>

##排除图像

<?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

?>