2017 © Pedro Peláez
 

library image-extractor

Image Extractor

image

ivoba/image-extractor

Image Extractor

  • Monday, September 8, 2014
  • by ivoba
  • Repository
  • 1 Watchers
  • 0 Stars
  • 43 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Image Extractor

Build Status Total Downloads, (*1)

Extensible Image Extractor to find all Image tags in a string. The library uses the symfony DomCrawler as base of extraction., (*2)

  • You can add multiple Extractors to find img tags or video tags to f.e resolve youtube thumbs. (or try the Video Preview Image Extractor)
  • You can add own XPath expressions to ImageXPathExtractor.
  • You can define custom & additional Extractors.
  • You can add multiple Filter to filter the found Images.
  • You can define custom Filter.
  • You can resolve relative image pathes with a FixRelativePathFilter.

As extractor a ImageXPathExtractor gets shipped, which fetches all img tags., (*3)

These filters are provided:, (*4)

  • a StrPosFilter which filters images that contain one of the given filter strings.
  • a FixRelativePathFilter that adds a basePath to all relative image paths.

Install

Via Composer, (*5)

``` json { "require": { "ivoba/image-extractor": "dev-master" } }, (*6)



## Usage ``` php $extractorList = [new ImageXPathExtractor()]; $filter = [new StrPosFilter(['flattr-badge', 'feedburner.com']]; $imageExtractor = new ImageExtractor($extractorList, $filter); $images = $imageExtractor->extract(file_get_contents($file));

A factory method for the default ImageExtractor with a default ImageXPathExtractor is provided:, (*7)

``` php $imageCreator = ImageExtractor::create();, (*8)


## Testing ``` bash $ phpunit

Contributing

Please see CONTRIBUTING for details., (*9)

Credits

  • Ivo Bathke(https://github.com/ivoba)

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

08/09 2014

dev-master

9999999-dev https://github.com/ivoba/image-extractor

Image Extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

parser image extractor scrapper

28/08 2014

v1.0.0

1.0.0.0 https://github.com/ivoba/image-extractor

Image Extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

parser image extractor scrapper