This commit is contained in:
Shish
2023-11-11 21:49:12 +00:00
parent 848797030e
commit fd1bb21f9d
235 changed files with 1551 additions and 1591 deletions

View File

@ -16,7 +16,7 @@ class ResizeImageInfo extends ExtensionInfo
public string $key = self::KEY;
public string $name = "Resize Post";
public array $authors = ["jgen"=>"jgen.tech@gmail.com"];
public array $authors = ["jgen" => "jgen.tech@gmail.com"];
public string $license = self::LICENSE_GPLV2;
public string $description = "This extension allows admins to resize images.";
public ?string $version = "0.1";

View File

@ -186,7 +186,7 @@ class ResizeImage extends Extension
[$new_width, $new_height] = get_scaled_by_aspect_ratio($event->image->width, $event->image->height, $max_width, $max_height);
if ($new_width!==$event->image->width || $new_height !==$event->image->height) {
if ($new_width !== $event->image->width || $new_height !== $event->image->height) {
$tmp_filename = tempnam(sys_get_temp_dir(), 'shimmie_resize');
if (empty($tmp_filename)) {
throw new ImageResizeException("Unable to save temporary image file.");
@ -201,7 +201,7 @@ class ResizeImage extends Extension
$new_height
));
if ($event->file_modified===true&&$event->path!=$event->image->get_image_filename()) {
if ($event->file_modified === true && $event->path != $event->image->get_image_filename()) {
// This means that we're dealing with a temp file that will need cleaned up
unlink($event->path);
}