| @@ 449-460 (lines=12) @@ | ||
| 446 | } |
|
| 447 | $iType = exif_imagetype($imagePath); |
|
| 448 | switch ($iType) { |
|
| 449 | case IMAGETYPE_GIF: |
|
| 450 | if (imagetypes() & IMG_GIF) { |
|
| 451 | $this->resource = imagecreatefromgif($imagePath); |
|
| 452 | // Preserve transparency |
|
| 453 | imagealphablending($this->resource, true); |
|
| 454 | imagesavealpha($this->resource, true); |
|
| 455 | } else { |
|
| 456 | OC_Log::write('core', |
|
| 457 | 'OC_Image->loadFromFile, GIF images not supported: '.$imagePath, |
|
| 458 | OC_Log::DEBUG); |
|
| 459 | } |
|
| 460 | break; |
|
| 461 | case IMAGETYPE_JPEG: |
|
| 462 | if (imagetypes() & IMG_JPG) { |
|
| 463 | $this->resource = imagecreatefromjpeg($imagePath); |
|
| @@ 470-481 (lines=12) @@ | ||
| 467 | OC_Log::DEBUG); |
|
| 468 | } |
|
| 469 | break; |
|
| 470 | case IMAGETYPE_PNG: |
|
| 471 | if (imagetypes() & IMG_PNG) { |
|
| 472 | $this->resource = imagecreatefrompng($imagePath); |
|
| 473 | // Preserve transparency |
|
| 474 | imagealphablending($this->resource, true); |
|
| 475 | imagesavealpha($this->resource, true); |
|
| 476 | } else { |
|
| 477 | OC_Log::write('core', |
|
| 478 | 'OC_Image->loadFromFile, PNG images not supported: '.$imagePath, |
|
| 479 | OC_Log::DEBUG); |
|
| 480 | } |
|
| 481 | break; |
|
| 482 | case IMAGETYPE_XBM: |
|
| 483 | if (imagetypes() & IMG_XPM) { |
|
| 484 | $this->resource = imagecreatefromxbm($imagePath); |
|