mirror of
https://github.com/Intervention/image.git
synced 2025-08-22 21:42:53 +02:00
tiff support
This commit is contained in:
@@ -69,6 +69,13 @@ abstract class AbstractEncoder
|
|||||||
$this->result = $this->processJpeg();
|
$this->result = $this->processJpeg();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'tiff':
|
||||||
|
case 'image/tiff':
|
||||||
|
if (method_exists($this, 'processTiff')) {
|
||||||
|
$this->result = $this->processTiff();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//fall through
|
||||||
default:
|
default:
|
||||||
throw new \Intervention\Image\Exception\NotSupportedException(
|
throw new \Intervention\Image\Exception\NotSupportedException(
|
||||||
"Writing format ({$format}) is not supported."
|
"Writing format ({$format}) is not supported."
|
||||||
|
@@ -65,4 +65,26 @@ class Encoder extends \Intervention\Image\AbstractEncoder
|
|||||||
|
|
||||||
return (string) $imagick;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user