|
@@ 501-510 (lines=10) @@
|
| 498 |
|
} |
| 499 |
|
$iType = exif_imagetype($imagePath); |
| 500 |
|
switch ($iType) { |
| 501 |
|
case IMAGETYPE_GIF: |
| 502 |
|
if (imagetypes() & IMG_GIF) { |
| 503 |
|
$this->resource = imagecreatefromgif($imagePath); |
| 504 |
|
// Preserve transparency |
| 505 |
|
imagealphablending($this->resource, true); |
| 506 |
|
imagesavealpha($this->resource, true); |
| 507 |
|
} else { |
| 508 |
|
$this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, array('app' => 'core')); |
| 509 |
|
} |
| 510 |
|
break; |
| 511 |
|
case IMAGETYPE_JPEG: |
| 512 |
|
if (imagetypes() & IMG_JPG) { |
| 513 |
|
$this->resource = imagecreatefromjpeg($imagePath); |
|
@@ 518-527 (lines=10) @@
|
| 515 |
|
$this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, array('app' => 'core')); |
| 516 |
|
} |
| 517 |
|
break; |
| 518 |
|
case IMAGETYPE_PNG: |
| 519 |
|
if (imagetypes() & IMG_PNG) { |
| 520 |
|
$this->resource = imagecreatefrompng($imagePath); |
| 521 |
|
// Preserve transparency |
| 522 |
|
imagealphablending($this->resource, true); |
| 523 |
|
imagesavealpha($this->resource, true); |
| 524 |
|
} else { |
| 525 |
|
$this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, array('app' => 'core')); |
| 526 |
|
} |
| 527 |
|
break; |
| 528 |
|
case IMAGETYPE_XBM: |
| 529 |
|
if (imagetypes() & IMG_XPM) { |
| 530 |
|
$this->resource = imagecreatefromxbm($imagePath); |