mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-08 14:14:26 +08: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
|
||||
{
|
||||
public static function createFromString(string $data);
|
||||
public static function createFromString(string &$data);
|
||||
|
||||
public function getOrientation() : int;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class GD2 implements \SnappyMail\Image
|
|||
return $this->getImageBlob();
|
||||
}
|
||||
|
||||
public static function createFromString(string $data)
|
||||
public static function createFromString(string &$data)
|
||||
{
|
||||
if (!($imginfo = \getimagesizefromstring($data))) {
|
||||
throw new \InvalidArgumentException('Invalid image');
|
||||
|
|
|
@ -14,7 +14,7 @@ class GMagick extends \Gmagick implements \SnappyMail\Image
|
|||
$this->clear();
|
||||
}
|
||||
|
||||
public static function createFromString(string $data)
|
||||
public static function createFromString(string &$data)
|
||||
{
|
||||
$gmagick = new static();
|
||||
if (!$gmagick->readimageblob($data)) {
|
||||
|
|
|
@ -11,7 +11,7 @@ class IMagick extends \Imagick implements \SnappyMail\Image
|
|||
$this->clear();
|
||||
}
|
||||
|
||||
public static function createFromString(string $data)
|
||||
public static function createFromString(string &$data)
|
||||
{
|
||||
$imagick = new static();
|
||||
if (!$imagick->readImageBlob($data)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue