Skip to content

Commit

Permalink
Merge pull request #22 from foaly-nr1/patch-explicit-format
Browse files Browse the repository at this point in the history
Added support for explicit input format
  • Loading branch information
Jérôme Poskin committed Nov 30, 2015
2 parents c146125 + 1629f7d commit 40d3009
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,14 @@ private function convertFormat($format)
*/
private function checkImage($path)
{
// remove explicit format if present
if(preg_match("/:(?!\/\/)/", $path) === 1) {
$path = preg_split("/:(?!\/\/)/", $path);
$path = $path[1];
}

if (!file_exists($this->getWebDirectory() . '/' . $path) && !file_exists($path)) {
throw new NotFoundException(sprintf("Unable to find the image \"%s\" to cache", $path));
throw new NotFoundException(sprintf("Unable to find image \"%s\"", $path));
}

if (!is_file($this->getWebDirectory() . '/' . $path) && !is_file($path)) {
Expand Down

0 comments on commit 40d3009

Please sign in to comment.