for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Del\Image\Strategy;
class GifStrategy extends AbstractTransparentImage implements ImageTypeStrategyInterface
{
/**
* @param string $filename
* @return resource
*/
public function create($filename)
return imagecreatefromgif($filename);
}
* @param resource $resource
* @param int $compression
* @return void
public function save($resource, $filename, $compression)
unset($compression);
imagegif($resource, $filename);
* @return string
public function getContentType()
return 'image/gif';
* @param $resource
public function render($resource)
imagegif($resource);
public function handleTransparency($newImage, $image)
// Get transparency color's index number
$transparency = $this->getTransparencyIndex($image);
// Is a strange index other than -1 set?
if ($transparency >= 0) {
// deal with alpha channels
$this->prepWithExistingIndex($newImage, $image, $transparency);