mirror of
https://github.com/Intervention/image.git
synced 2025-02-06 22:00:38 +01:00
tiff support
This commit is contained in:
parent
0598667afb
commit
b4496073ac
@ -69,6 +69,13 @@ abstract class AbstractEncoder
|
||||
$this->result = $this->processJpeg();
|
||||
break;
|
||||
|
||||
case 'tiff':
|
||||
case 'image/tiff':
|
||||
if (method_exists($this, 'processTiff')) {
|
||||
$this->result = $this->processTiff();
|
||||
break;
|
||||
}
|
||||
//fall through
|
||||
default:
|
||||
throw new \Intervention\Image\Exception\NotSupportedException(
|
||||
"Writing format ({$format}) is not supported."
|
||||
|
@ -65,4 +65,26 @@ class Encoder extends \Intervention\Image\AbstractEncoder
|
||||
|
||||
return (string) $imagick;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes and returns encoded image as TIFF string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function processTiff()
|
||||
{
|
||||
$format = 'tiff';
|
||||
$compression = \Imagick::COMPRESSION_UNDEFINED;
|
||||
|
||||
$imagick = $this->image->getCore();
|
||||
$imagick->setFormat($format);
|
||||
$imagick->setImageFormat($format);
|
||||
$imagick->setCompression($compression);
|
||||
$imagick->setImageCompression($compression);
|
||||
$imagick->setCompressionQuality($this->quality);
|
||||
$imagick->setImageCompressionQuality($this->quality);
|
||||
|
||||
return (string) $imagick;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user