From 6b3b447e3b6af26315c9b20e69943a3b395b9347 Mon Sep 17 00:00:00 2001 From: kato Date: Mon, 9 Dec 2024 14:24:19 +0900 Subject: [PATCH] =?UTF-8?q?fix=20#4072=20[=E8=A6=81=E6=9C=9B]=20=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E3=82=92=E3=82=A2=E3=83=83=E3=83=95=E3=82=9A=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=82=99=E3=81=99=E3=82=8B=E3=81=A8=E5=85=83?= =?UTF-8?q?=E7=94=BB=E5=83=8F=E3=82=88=E3=82=8A=E5=AE=B9=E9=87=8F=E3=81=8B?= =?UTF-8?q?=E3=82=99=E5=A4=A7=E3=81=8D=E3=81=8F=E3=81=AA=E3=82=8B=E4=BA=8B?= =?UTF-8?q?=E3=81=8C=E3=81=82=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E8=A7=A3?= =?UTF-8?q?=E6=B1=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/app_local.example.php | 2 ++ plugins/baser-core/src/Vendor/Imageresizer.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/config/app_local.example.php b/config/app_local.example.php index 8bdb855dd5..9a77d27e6e 100644 --- a/config/app_local.example.php +++ b/config/app_local.example.php @@ -91,4 +91,6 @@ 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null), ], ], + // thmbnailの解像度を変更する場合 + // 'resizeResolution' => 72, ]; diff --git a/plugins/baser-core/src/Vendor/Imageresizer.php b/plugins/baser-core/src/Vendor/Imageresizer.php index 41a1d41c95..1f0d7e0e66 100644 --- a/plugins/baser-core/src/Vendor/Imageresizer.php +++ b/plugins/baser-core/src/Vendor/Imageresizer.php @@ -129,6 +129,12 @@ function resize($imgPath, $savePath = null, $newWidth = null, $newHeight = null, @unlink($savePath); } + // ConfigのresizeResolutionの値があって、デフォルト(96dpi)より小さい場合、解像度を上書きする + $resizeResolution = \Cake\Core\Configure::read('resizeResolution'); + if (!empty($resizeResolution) && (int) $resizeResolution < 96 ){ + imageresolution($newImage, $resizeResolution, $resizeResolution); + } + switch($image_type) { case IMAGETYPE_GIF: if ($savePath) {