From 0536025ff689d05711a40fcd255ee625904bbddb Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 20 May 2009 04:04:50 +0000 Subject: Add a default image quality level. There's no UI for it, except Admin > Settings > Advanced. The default is 75. --- core/helpers/core_installer.php | 1 + core/helpers/graphics.php | 3 +++ 2 files changed, 4 insertions(+) (limited to 'core/helpers') diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php index 3a1e8d25..fc4dc1a6 100644 --- a/core/helpers/core_installer.php +++ b/core/helpers/core_installer.php @@ -216,6 +216,7 @@ class core_installer { module::set_var("core", "thumb_size", 200); module::set_var("core", "resize_size", 640); module::set_var("core", "default_locale", "en_US"); + module::set_var("core", "image_quality", 75); // Add rules for generating our thumbnails and resizes graphics::add_rule( diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index 7e0c3e5d..b4729532 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -166,6 +166,7 @@ class graphics_Core { } else { Image::factory($input_file) ->resize($options["width"], $options["height"], $options["master"]) + ->quality(module::get_var("core", "image_quality")) ->save($output_file); } } @@ -183,6 +184,7 @@ class graphics_Core { } Image::factory($input_file) + ->quality(module::get_var("core", "image_quality")) ->rotate($options["degrees"]) ->save($output_file); } @@ -232,6 +234,7 @@ class graphics_Core { Image::factory($input_file) ->composite($options["file"], $x, $y, $options["transparency"]) + ->quality(module::get_var("core", "image_quality")) ->save($output_file); } -- cgit v1.2.3