diff --git a/conf/conf.php b/conf/conf.php index 801c3e6..67f380a 100755 --- a/conf/conf.php +++ b/conf/conf.php @@ -6,6 +6,9 @@ define('MAX_WORDS', 4); define('MAX_ZAPS', 9); +define('ZAP_DEFAULT_WIDTH', 1067); +define('ZAP_DEFAULT_HEIGHT', 600); + define('ZAP_CURL_TIMEOUT', 12); define('ZAP_IMG_TYPE', 'jpg'); define('ZAP_CANVAS_NAME', 'collage'); diff --git a/lib/ImgIOTools.class.php b/lib/ImgIOTools.class.php index a41127f..724d091 100755 --- a/lib/ImgIOTools.class.php +++ b/lib/ImgIOTools.class.php @@ -3,9 +3,6 @@ * Image Input Output Tools */ class ImgIOTools { - public static $maxScreenWidth = 1067; //screen dimensions - - public static $maxScreenHeight = 600; /** * Flushes image to screen @@ -13,9 +10,9 @@ class ImgIOTools { * @return void */ public static function onScreen(Imagick $img) { - $img->scaleImage(self::$maxScreenWidth, self::$maxScreenHeight, true); + $img->scaleImage(ZAP_DEFAULT_WIDTH, ZAP_DEFAULT_HEIGHT, true); - //$img = self::scaleByLength($img, $this->maxScreenWidth, $this->maxScreenHeight); + //$img = self::scaleByLength($img, ZAP_DEFAULT_WIDTH, ZAP_DEFAULT_HEIGHT); header('Content-type: image/' . ZAP_IMG_TYPE); echo $img->getImageBlob(); } @@ -46,5 +43,4 @@ class ImgIOTools { $path = $folder . $filename . '.' . ZAP_IMG_TYPE; return $img->writeImage($path); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/ImgTools.class.php b/lib/ImgTools.class.php index e743235..2cd68b0 100755 --- a/lib/ImgTools.class.php +++ b/lib/ImgTools.class.php @@ -3,10 +3,6 @@ * Library of tool functions to manipulate an image */ class ImgTools { - public static $maxScreenWidth = 1067; //screen dimensions - - public static $maxScreenHeight = 600; - public static $minFuzzFactor = 0.08; //minimal factor for $fuzz public static $maxFuzzFactor = 0.64; //maximal factor for $fuzz @@ -161,7 +157,7 @@ class ImgTools { public static function scaleByLength(Imagick $img, $maxW, $maxH) { $width = $img->getImageWidth(); $height = $img->getImageHeight(); - if(($width <= self::$maxScreenWidth) && ($height <= self::$maxScreenHeight)) { + if(($width <= ZAP_DEFAULT_WIDTH) && ($height <= ZAP_DEFAULT_HEIGHT)) { return $img; } else { if ($width >= $height) { //horizontal image diff --git a/tpl/index.tpl b/tpl/index.tpl index 249b112..68354e2 100755 --- a/tpl/index.tpl +++ b/tpl/index.tpl @@ -32,10 +32,10 @@
- width px + width px
- height px + height px