}
$thumb = false;
+ $size = 1024;
// If the cache path isn't there, try to create it
if (!is_dir($_SERVER["DOCUMENT_ROOT"]."/privacy_image_cache"))
else
$url = $a->argv[1];
+ //$thumb = (isset($a->argv[3]) and ($a->argv[3] == "thumb"));
+ if (isset($a->argv[3]) and ($a->argv[3] == "thumb"))
+ $size = 200;
+
+ // thumb, small, medium and large.
+ if (substr($url, -6) == ":thumb")
+ $size = 150;
+ if (substr($url, -6) == ":small")
+ $size = 340;
+ if (substr($url, -7) == ":medium")
+ $size = 600;
+ if (substr($url, -6) == ":large")
+ $size = 1024;
+
$pos = strrpos($url, "=.");
if ($pos)
$url = substr($url, 0, $pos+1);
if ($url)
$_REQUEST['url'] = $url;
- $thumb = (isset($a->argv[3]) and ($a->argv[3] == "thumb"));
}
if (!$direct_cache) {
if (!$direct_cache AND ($cachefile == ""))
$img->store(0, 0, $urlhash, $_REQUEST['url'], '', 100);
- if ($thumb) {
- $img->scaleImage(200); // Test
- $img_str = $img->imageString();
- }
+ //if ($thumb) {
+ // $img->scaleImage(200); // Test
+ // $img_str = $img->imageString();
+ //}
}
//$mime = "image/jpeg";
}
if ($mime != "image/gif") {
$img = new Photo($img_str, $mime);
if($img->is_valid()) {
- $img->scaleImage(1024); // Test
+ //$img->scaleImage(1024); // Test
+ $img->scaleImage($size);
$img_str = $img->imageString();
}
}