Permalink
Browse files

Merge pull request #507 from patrickheck/patch-7

Deal nicely with GIF files that have an illegal index-color set.
  • Loading branch information...
2 parents 2599adf + 1c38ece commit 1e519596f130fe0d9c77ca0f4ac01c90c76d4df3 @aembler aembler committed May 1, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 web/concrete/helpers/image.php
View
2 web/concrete/helpers/image.php
@@ -130,7 +130,7 @@ public function create($originalPath, $newPath, $width, $height, $crop = false)
$trnprt_indx = imagecolortransparent($im);
// If we have a specific transparent color
- if ($trnprt_indx >= 0) {
+ if ($trnprt_indx >= 0 && $trnprt_indx < imagecolorstotal($im)) {
// Get the original image's transparent color's RGB values
$trnprt_color = imagecolorsforindex($im, $trnprt_indx);

0 comments on commit 1e51959

Please sign in to comment.