Commit 83b567c9 authored by Dries's avatar Dries

Issue #1937140 by ACF: Convert image_jpeg_quality() to cmi.

parent 224b3c98
preview_image: core/modules/image/sample.png
allow_insecure_derivatives: false
jpeg_quality: 75
......@@ -176,5 +176,6 @@ function image_update_8001() {
function image_update_8002() {
update_variables_to_config('image.settings', array(
'image_style_preview_image' => 'preview_image',
'image_jpeg_quality' => 'jpeg_quality',
));
}
......@@ -37,7 +37,7 @@ function image_gd_settings() {
'#description' => t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'),
'#min' => 0,
'#max' => 100,
'#default_value' => variable_get('image_jpeg_quality', 75),
'#default_value' => config('image.settings')->get('jpeg_quality'),
'#field_suffix' => t('%'),
);
......@@ -296,7 +296,8 @@ function image_gd_save(stdClass $image, $destination) {
return FALSE;
}
if ($extension == 'jpeg') {
$success = $function($image->resource, $destination, variable_get('image_jpeg_quality', 75));
$quality = config('image.settings')->get('jpeg_quality');
$success = $function($image->resource, $destination, $quality);
}
else {
// Always save PNG images with full transparency.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment