1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

add pdf and mobi libraries

This commit is contained in:
tcit 2014-07-24 15:49:36 +02:00
parent 2b58426b2d
commit 4188f38ad5
297 changed files with 126557 additions and 7 deletions

View file

@ -0,0 +1,28 @@
<?php
class ImageHandler {
/**
* Download an image
* @param string $url Url to the image
* @return false|string False if failed, else the data of the image (converted to grayscale jpeg)
*/
public static function DownloadImage($url){
$data = Http::Request($url);
$imgFile = @imagecreatefromstring($data);
if($imgFile !== false){
@imagefilter($imgFile, IMG_FILTER_GRAYSCALE);
ob_start();
@imagejpeg($imgFile);
$image = ob_get_contents();
ob_end_clean();
@imagedestroy($imgFile);
return $image;
}
return false;
}
}
?>