mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 01:17:04 +03:00
Reduce image memory usage
This commit is contained in:
parent
a36a8113bb
commit
a8fd699575
4 changed files with 4 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ namespace SnappyMail;
|
||||||
|
|
||||||
interface Image
|
interface Image
|
||||||
{
|
{
|
||||||
public static function createFromString(string $data);
|
public static function createFromString(string &$data);
|
||||||
|
|
||||||
public function getOrientation() : int;
|
public function getOrientation() : int;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class GD2 implements \SnappyMail\Image
|
||||||
return $this->getImageBlob();
|
return $this->getImageBlob();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createFromString(string $data)
|
public static function createFromString(string &$data)
|
||||||
{
|
{
|
||||||
if (!($imginfo = \getimagesizefromstring($data))) {
|
if (!($imginfo = \getimagesizefromstring($data))) {
|
||||||
throw new \InvalidArgumentException('Invalid image');
|
throw new \InvalidArgumentException('Invalid image');
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class GMagick extends \Gmagick implements \SnappyMail\Image
|
||||||
$this->clear();
|
$this->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createFromString(string $data)
|
public static function createFromString(string &$data)
|
||||||
{
|
{
|
||||||
$gmagick = new static();
|
$gmagick = new static();
|
||||||
if (!$gmagick->readimageblob($data)) {
|
if (!$gmagick->readimageblob($data)) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ class IMagick extends \Imagick implements \SnappyMail\Image
|
||||||
$this->clear();
|
$this->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createFromString(string $data)
|
public static function createFromString(string &$data)
|
||||||
{
|
{
|
||||||
$imagick = new static();
|
$imagick = new static();
|
||||||
if (!$imagick->readImageBlob($data)) {
|
if (!$imagick->readImageBlob($data)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue