Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+51
View File
@@ -33,6 +33,8 @@ class Image
exit;
}
}
$this->image_wrapper->reencode();
}
public function resize($max_size_for_picture)
@@ -157,6 +159,7 @@ abstract class ImageWrapper
}
$this->path = $path;
$this->set_image_wrapper(); //Creates image obj
$this->reencode();
}
abstract public function set_image_wrapper();
@@ -169,6 +172,8 @@ abstract class ImageWrapper
abstract public function crop($x, $y, $width, $height, $src_width, $src_height);
abstract public function reencode(): void;
abstract public function send_image($file = '', $compress = -1, $convert_file_to = null);
/**
@@ -347,6 +352,27 @@ class ImagickWrapper extends ImageWrapper
return $result;
}
}
/**
* @throws Exception
*/
public function reencode(): void
{
if ($this->image_validated) {
try {
$this->image->setImageFormat($this->type);
$this->image->writeImage($this->path);
} catch (ImagickException $e) {
throw new Exception();
}
$this->image->clear();
return;
}
throw new Exception();
}
}
/**
@@ -482,6 +508,31 @@ class GDWrapper extends ImageWrapper
@imagedestroy($src_img);
}
/**
* @throws Exception
*/
public function reencode(): void
{
if (!$this->image_validated) {
return;
}
switch ($this->type) {
case 'jpeg':
case 'jpg':
imagejpeg($this->bg, $this->path);
break;
case 'png':
imagepng($this->bg, $this->path);
break;
case 'gif':
imagegif($this->bg, $this->path);
break;
}
}
/**
* @author José Loguercio <jose.loguercio@beeznest.com>
*