Created
May 10, 2012 15:13
-
-
Save aertmann/2653813 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
$imageSize = getimagesize('resource://' . $this->resource->getResourcePointer()->getHash()); | |
if ($imageSize === FALSE) { | |
throw new \TYPO3\Media\Exception('The given resource was not a valid image file'); | |
} | |
$this->width = (integer)$imageSize[0]; | |
$this->height = (integer)$imageSize[1]; | |
$this->type = (integer)$imageSize[2]; | |
} catch(\TYPO3\Media\Domain\Model\Exception\InvalidImageContentException $exception) { | |
throw new \TYPO3\Media\Exception($exception->getMessage(), $exception->getCode()); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment