diff options
-rw-r--r-- | composer.json | 6 | ||||
-rw-r--r-- | src/PHPImageWorkshop/ImageWorkshop.php | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/composer.json b/composer.json index 34c0788..fcbad42 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,14 @@ ], "require": { "php": ">=5.3.0", - "ext-gd": "*", - "ext-exif": "*" + "ext-gd": "*" }, "require-dev": { "phpunit/phpunit": "~4.5" }, + "suggest": { + "ext-exif": "Allows to read and keep images EXIF data" + }, "autoload": { "psr-0": { "PHPImageWorkshop": "src" } } diff --git a/src/PHPImageWorkshop/ImageWorkshop.php b/src/PHPImageWorkshop/ImageWorkshop.php index f3a4650..bdedb20 100644 --- a/src/PHPImageWorkshop/ImageWorkshop.php +++ b/src/PHPImageWorkshop/ImageWorkshop.php @@ -73,8 +73,9 @@ class ImageWorkshop switch ($mimeContentType) {
case 'jpeg':
$image = imageCreateFromJPEG($path);
- if (false === ($exif = @read_exif_data($path))) {
- $exif = array();
+
+ if (function_exists('read_exif_data') && false !== ($data = @read_exif_data($path))) {
+ $exif = $data;
}
break;
|