| @@ 121-133 (lines=13) @@ | ||
| 118 | public function resizeAndCrop() |
|
| 119 | { |
|
| 120 | // check file extension |
|
| 121 | switch ($this->imageMimetype) { |
|
| 122 | case 'image/png': |
|
| 123 | $original = imagecreatefrompng($this->sourceFile); |
|
| 124 | break; |
|
| 125 | case 'image/jpeg': |
|
| 126 | $original = imagecreatefromjpeg($this->sourceFile); |
|
| 127 | break; |
|
| 128 | case 'image/gif': |
|
| 129 | $original = imagecreatefromgif($this->sourceFile); |
|
| 130 | break; |
|
| 131 | default: |
|
| 132 | return 'Unsupported format'; |
|
| 133 | } |
|
| 134 | ||
| 135 | if (!$original) { |
|
| 136 | return false; |
|
| @@ 248-260 (lines=13) @@ | ||
| 245 | public function rotateImage() |
|
| 246 | { |
|
| 247 | // check file extension |
|
| 248 | switch ($this->imageMimetype) { |
|
| 249 | case 'image/png': |
|
| 250 | $original = imagecreatefrompng($this->sourceFile); |
|
| 251 | break; |
|
| 252 | case 'image/jpeg': |
|
| 253 | $original = imagecreatefromjpeg($this->sourceFile); |
|
| 254 | break; |
|
| 255 | case 'image/gif': |
|
| 256 | $original = imagecreatefromgif($this->sourceFile); |
|
| 257 | break; |
|
| 258 | default: |
|
| 259 | return 'Unsupported format'; |
|
| 260 | } |
|
| 261 | ||
| 262 | if (!$original) { |
|
| 263 | return false; |
|