filepreviews/filepreviews

PHP client library for FilePreviews.io

v1.0.1 2015-11-16 17:10 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:12:42 UTC


README

PHP client library for the FilePreviews.io service. Generate image previews and metadata from almost any kind of file.

Installation

composer require filepreviews/filepreviews

Example code

$fp = new FilePreviews\FilePreviews([
  'api_key' => 'API_KEY_HERE',
  'api_secret' => 'API_KEY_HERE'
]);

$response = $fp->generate($url);
print_r($response);

$response = $fp->retrieve($response->id);
print_r($response);

Options

You can optionally send an options associative array.

$fp = new FilePreviews\FilePreviews([
  'api_key' => 'API_KEY_HERE',
  'api_secret' => 'API_KEY_HERE'
]);

$options = [
  'size' => [
    'width' => 250,
    'height' => 250
  ],
  'format' => 'jpg',
  'pages' => '1',
  'metadata' => ['exif', 'ocr', 'psd'],
  'data' => ['foo' => 'bar']
];

$response = $fp->generate($url, $options);
print_r($response);