<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aportela / remote-thumbnail-cache-wrapper example snippets
er = new \Psr\Log\NullLogger("");
// cached thumbnails will be stored on this path
$localPath = "./data/";
$thumbnail = new \aportela\RemoteThumbnailCacheWrapper\JPEGThumbnail($logger, $localPath);
$thumbnail->setDimensions(250, 250);
$thumbnail->setQuality(\aportela\RemoteThumbnailCacheWrapper\JPEGThumbnail::DEFAULT_IMAGE_QUALITY);
if ($thumbnail->getFromRemoteURL("https://i.imgur.com/1bo3VaU.jpeg")) {
header("Content-Type: image/jpeg");
readfile($thumbnail->path);
} else {
header("HTTP/1.1 404 Not Found");
}
er = new \Psr\Log\NullLogger("");
// cached thumbnails will be stored on this path
$localPath = "./data/";
$thumbnail = new \aportela\RemoteThumbnailCacheWrapper\PNGThumbnail($logger, $localPath);
$thumbnail->setDimensions(250, 250);
$thumbnail->setQuality(\aportela\RemoteThumbnailCacheWrapper\PNGThumbnail::DEFAULT_IMAGE_QUALITY);
if ($thumbnail->getFromLocalFilesystem("/tmp/test.jpg")) {
header("Content-Type: image/png");
readfile($thumbnail->path);
} else {
header("HTTP/1.1 404 Not Found");
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.