mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Moved GD::set_default_quality() function to the top of the file to align with conventions
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111888 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cd05f945ad
commit
507f9909bd
@ -9,7 +9,17 @@ class GD extends Object {
|
|||||||
protected $quality;
|
protected $quality;
|
||||||
|
|
||||||
protected static $default_quality = 75;
|
protected static $default_quality = 75;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the default image quality.
|
||||||
|
* @param quality int A number from 0 to 100, 100 being the best quality.
|
||||||
|
*/
|
||||||
|
static function set_default_quality($quality) {
|
||||||
|
if(is_numeric($quality) && (int) $quality >= 0 && (int) $quality <= 100) {
|
||||||
|
self::$default_quality = (int) $quality;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function __construct($filename = null) {
|
function __construct($filename = null) {
|
||||||
// If we're working with image resampling, things could take a while. Bump up the time-limit
|
// If we're working with image resampling, things could take a while. Bump up the time-limit
|
||||||
increase_time_limit_to(300);
|
increase_time_limit_to(300);
|
||||||
@ -38,16 +48,6 @@ class GD extends Object {
|
|||||||
return $this->gd;
|
return $this->gd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the default image quality.
|
|
||||||
* @param quality int A number from 0 to 100, 100 being the best quality.
|
|
||||||
*/
|
|
||||||
static function set_default_quality($quality) {
|
|
||||||
if(is_numeric($quality) && (int) $quality >= 0 && (int) $quality <= 100) {
|
|
||||||
self::$default_quality = (int) $quality;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the image quality, used when saving JPEGs.
|
* Set the image quality, used when saving JPEGs.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user