|
@@ 477-486 (lines=10) @@
|
| 474 |
|
} |
| 475 |
|
$iType = exif_imagetype($imagePath); |
| 476 |
|
switch ($iType) { |
| 477 |
|
case IMAGETYPE_GIF: |
| 478 |
|
if (imagetypes() & IMG_GIF) { |
| 479 |
|
$this->resource = imagecreatefromgif($imagePath); |
| 480 |
|
// Preserve transparency |
| 481 |
|
imagealphablending($this->resource, true); |
| 482 |
|
imagesavealpha($this->resource, true); |
| 483 |
|
} else { |
| 484 |
|
$this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, array('app' => 'core')); |
| 485 |
|
} |
| 486 |
|
break; |
| 487 |
|
case IMAGETYPE_JPEG: |
| 488 |
|
if (imagetypes() & IMG_JPG) { |
| 489 |
|
$this->resource = imagecreatefromjpeg($imagePath); |
|
@@ 494-503 (lines=10) @@
|
| 491 |
|
$this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, array('app' => 'core')); |
| 492 |
|
} |
| 493 |
|
break; |
| 494 |
|
case IMAGETYPE_PNG: |
| 495 |
|
if (imagetypes() & IMG_PNG) { |
| 496 |
|
$this->resource = imagecreatefrompng($imagePath); |
| 497 |
|
// Preserve transparency |
| 498 |
|
imagealphablending($this->resource, true); |
| 499 |
|
imagesavealpha($this->resource, true); |
| 500 |
|
} else { |
| 501 |
|
$this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, array('app' => 'core')); |
| 502 |
|
} |
| 503 |
|
break; |
| 504 |
|
case IMAGETYPE_XBM: |
| 505 |
|
if (imagetypes() & IMG_XPM) { |
| 506 |
|
$this->resource = imagecreatefromxbm($imagePath); |