diff options
author | tcit <tcit@tcit.fr> | 2014-07-24 21:56:04 +0200 |
---|---|---|
committer | tcit <tcit@tcit.fr> | 2014-07-24 21:56:04 +0200 |
commit | fb9df0c269f36703909b8b259abbdbed29881ecd (patch) | |
tree | 03069262fe6a7bd5891f5649d31fc057b3ca8541 /inc/3rdparty/libraries/send2kindle/MOBIClass/ImageHandler.php | |
parent | c70bfefc68fcc96b1ce57845e5b2942a596239ec (diff) | |
download | wallabag-fb9df0c269f36703909b8b259abbdbed29881ecd.tar.gz wallabag-fb9df0c269f36703909b8b259abbdbed29881ecd.tar.zst wallabag-fb9df0c269f36703909b8b259abbdbed29881ecd.zip |
use directly MOBIClass
Diffstat (limited to 'inc/3rdparty/libraries/send2kindle/MOBIClass/ImageHandler.php')
-rw-r--r-- | inc/3rdparty/libraries/send2kindle/MOBIClass/ImageHandler.php | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/inc/3rdparty/libraries/send2kindle/MOBIClass/ImageHandler.php b/inc/3rdparty/libraries/send2kindle/MOBIClass/ImageHandler.php deleted file mode 100644 index f620fc1f..00000000 --- a/inc/3rdparty/libraries/send2kindle/MOBIClass/ImageHandler.php +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | class ImageHandler { | ||
4 | /** | ||
5 | * Download an image | ||
6 | * @param string $url Url to the image | ||
7 | * @return false|string False if failed, else the data of the image (converted to grayscale jpeg) | ||
8 | */ | ||
9 | public static function DownloadImage($url){ | ||
10 | $data = Http::Request($url); | ||
11 | $imgFile = @imagecreatefromstring($data); | ||
12 | |||
13 | if($imgFile !== false){ | ||
14 | @imagefilter($imgFile, IMG_FILTER_GRAYSCALE); | ||
15 | |||
16 | ob_start(); | ||
17 | @imagejpeg($imgFile); | ||
18 | $image = ob_get_contents(); | ||
19 | ob_end_clean(); | ||
20 | |||
21 | @imagedestroy($imgFile); | ||
22 | |||
23 | return $image; | ||
24 | } | ||
25 | return false; | ||
26 | } | ||
27 | } | ||
28 | ?> | ||