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) {