To participate you must create an account on apostrophenow.org. If you have already done so, click Login.
Changeset 2329
- Timestamp:
- 10/04/10 18:51:51 (3 years ago)
- Author:
- tboutell
- Message:
-
Fixed #626 (don't play with EXIF if the file is not a JPEG)
- Location:
- plugins/apostrophePlugin/trunk/lib/toolkit
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r2301
|
r2329
|
|
| 644 | 644 | static public function getRealUrl() |
| 645 | 645 | { |
| 646 | | if(isset(aTools::$realUrl)) |
| | 646 | if (isset(aTools::$realUrl)) |
| 647 | 647 | { |
| 648 | 648 | return aTools::$realUrl; |
-
|
r2315
|
r2329
|
|
| 122 | 122 | static private function scaleBody($fileIn, $fileOut, $scaleParameters = array(), $cropParameters = array(), $quality = 75) |
| 123 | 123 | { |
| 124 | | error_log("ENTERING scaleBody"); |
| 125 | 124 | if (sfConfig::get('app_aimageconverter_netpbm', true)) |
| 126 | 125 | { |
| … |
… |
|
| 132 | 131 | if (sfConfig::get('app_aimageconverter_netpbm', true) === 'always') |
| 133 | 132 | { |
| 134 | | error_log("Calling scaleNetpbm"); |
| 135 | 133 | return self::scaleNetpbm($fileIn, $fileOut, $scaleParameters, $cropParameters, $quality); |
| 136 | 134 | } |
| … |
… |
|
| 139 | 137 | if (($info !== false) && (($info[0] <= 1024) && ($info[1] <= 768)) && function_exists('imagetypes') && isset($mapTypes[$info[2]]) && (imagetypes() & $mapTypes[$info[2]])) |
| 140 | 138 | { |
| 141 | | error_log("FALLBACK"); |
| 142 | 139 | return self::scaleGd($fileIn, $fileOut, $scaleParameters, $cropParameters, $quality); |
| 143 | 140 | } |
| … |
… |
|
| 150 | 147 | else |
| 151 | 148 | { |
| 152 | | error_log("GD"); |
| 153 | 149 | return self::scaleGd($fileIn, $fileOut, $scaleParameters, $cropParameters, $quality); |
| 154 | 150 | } |
| … |
… |
|
| 165 | 161 | // case 8: // 90 rotate left |
| 166 | 162 | |
| 167 | | static public function getRotation($file) |
| 168 | | { |
| | 163 | static public function getRotation($file, $getimagesize = null) |
| | 164 | { |
| | 165 | if (is_null($getimagesize)) |
| | 166 | { |
| | 167 | $getimagesize = getimagesize($file); |
| | 168 | } |
| | 169 | if ($getimagesize[2] !== IMAGETYPE_JPEG) |
| | 170 | { |
| | 171 | return 1; |
| | 172 | } |
| 169 | 173 | if (!extension_loaded("exif")) |
| 170 | 174 | { |
| … |
… |
|
| 263 | 267 | $rotate = ''; |
| 264 | 268 | |
| 265 | | $rotation = aImageConverter::getRotation($fileIn); |
| | 269 | $rotation = aImageConverter::getRotation($fileIn, $info); |
| 266 | 270 | switch ($rotation) |
| 267 | 271 | { |
| … |
… |
|
| 361 | 365 | $width = $imageInfo[0]; |
| 362 | 366 | $height = $imageInfo[1]; |
| 363 | | $orientation = aImageConverter::getRotation($fileIn); |
| | 367 | $orientation = aImageConverter::getRotation($fileIn, $imageInfo); |
| 364 | 368 | if ($imageInfo[2] === IMAGETYPE_JPEG) |
| 365 | 369 | { |
| … |
… |
|
| 728 | 732 | { |
| 729 | 733 | // Some EXIF orientations swap width and height |
| 730 | | switch (aImageConverter::getRotation($file)) |
| | 734 | switch (aImageConverter::getRotation($file, $data)) |
| 731 | 735 | { |
| 732 | 736 | case 5: // vertical flip + 90 rotate right |
Download in other formats: