summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries2013-03-09 22:35:38 (GMT)
committerDries2013-03-09 22:35:38 (GMT)
commit83b567c9d8059e445845681766c83067332ace0d (patch)
tree11fce8db69186cd43f1d1b21662331689011ab7d
parent224b3c984ffb8d0571b47bdcfe958af2081f1a5a (diff)
Issue #1937140 by ACF: Convert image_jpeg_quality() to cmi.
-rw-r--r--core/modules/image/config/image.settings.yml1
-rw-r--r--core/modules/image/image.install1
-rw-r--r--core/modules/system/image.gd.inc5
3 files changed, 5 insertions, 2 deletions
diff --git a/core/modules/image/config/image.settings.yml b/core/modules/image/config/image.settings.yml
index f0f123f..2da8551 100644
--- a/core/modules/image/config/image.settings.yml
+++ b/core/modules/image/config/image.settings.yml
@@ -1,2 +1,3 @@
preview_image: core/modules/image/sample.png
allow_insecure_derivatives: false
+jpeg_quality: 75
diff --git a/core/modules/image/image.install b/core/modules/image/image.install
index e4e77d8..a000eb2 100644
--- a/core/modules/image/image.install
+++ b/core/modules/image/image.install
@@ -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',
));
}
diff --git a/core/modules/system/image.gd.inc b/core/modules/system/image.gd.inc
index 0d2f228..779117d 100644
--- a/core/modules/system/image.gd.inc
+++ b/core/modules/system/image.gd.inc
@@ -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.