|
1 | 1 | <?php
|
2 | 2 | /*
|
3 |
| - * jQuery File Upload Plugin PHP Class 6.11.1 |
| 3 | + * jQuery File Upload Plugin PHP Class 6.11.2 |
4 | 4 | * https://github.com/blueimp/jQuery-File-Upload
|
5 | 5 | *
|
6 | 6 | * Copyright 2010, Sebastian Tschan
|
@@ -813,14 +813,19 @@ protected function imagick_orient_image($file_path) {
|
813 | 813 |
|
814 | 814 | protected function get_image_size($file_path) {
|
815 | 815 | if ($this->options['image_library'] && extension_loaded('imagick')) {
|
816 |
| - $image = $this->imagick_get_image_object($file_path); |
817 |
| - return array($image->getImageWidth(), $image->getImageHeight()); |
| 816 | + $image = new Imagick(); |
| 817 | + if (@$image->pingImage($file_path)) { |
| 818 | + $dimensions = array($image->getImageWidth(), $image->getImageHeight()); |
| 819 | + $image->destroy(); |
| 820 | + return $dimensions; |
| 821 | + } |
| 822 | + return false; |
818 | 823 | }
|
819 | 824 | if (!function_exists('getimagesize')) {
|
820 | 825 | error_log('Function not found: getimagesize');
|
821 | 826 | return false;
|
822 | 827 | }
|
823 |
| - return getimagesize($file_path); |
| 828 | + return @getimagesize($file_path); |
824 | 829 | }
|
825 | 830 |
|
826 | 831 | protected function create_scaled_image($file_name, $version, $options) {
|
@@ -850,12 +855,8 @@ protected function is_valid_image_file($file_path) {
|
850 | 855 | if (function_exists('exif_imagetype')) {
|
851 | 856 | return @exif_imagetype($file_path);
|
852 | 857 | }
|
853 |
| - if (!function_exists('getimagesize')) { |
854 |
| - error_log('Function not found: getimagesize'); |
855 |
| - return false; |
856 |
| - } |
857 |
| - $image_info = @getimagesize($file_path); |
858 |
| - return !empty($image_info[0]); |
| 858 | + $image_info = $this->get_image_size($file_path); |
| 859 | + return $image_info && $image_info[0] && $image_info[1]; |
859 | 860 | }
|
860 | 861 |
|
861 | 862 | protected function handle_image_file($file_path, $file) {
|
|
0 commit comments