18 include_once (
"WHAT/Lib.Prefix.php");
19 include_once (
"WHAT/Lib.Http.php");
20 include_once (
"WHAT/Lib.Common.php");
28 $cmd = sprintf(
"convert -thumbnail %d %s %s",
$size, escapeshellarg($source) , escapeshellarg(
$dest));
40 $cmd = sprintf(
"/bin/cp %s %s", escapeshellarg($source) , escapeshellarg(
$dest));
51 $result = pg_query($rcore,
"SELECT val from paramv where name='FREEDOM_DB' and type='G'");
53 $row = pg_fetch_row($result);
59 $result = pg_query(
"select id_dir,name,public_access from vaultdiskstorage where id_file=$vid");
61 $row = pg_fetch_row($result);
67 if (!$free)
return false;
69 if (preg_match(
'/\.([^\.]*)$/',
$name, $reg)) {
73 $result = pg_query(
"SELECT l_path,id_fs from vaultdiskdirstorage where id_dir = $iddir");
74 $row = pg_fetch_row($result);
77 $result = pg_query(
"SELECT r_path from vaultdiskfsstorage where id_fs = $idfs");
78 $row = pg_fetch_row($result);
81 $localimg =
"$rpath/$lpath/$vid.$ext";
82 if (file_exists($localimg))
return $localimg;
94 $basedest =
"/img-cache/$size-vid$vid.png";
102 if ($vid > 0)
$img =
"vaultid=$vid";
107 if (preg_match(
"/vaultid=([0-9]+)/",
$img, $vids)) {
112 if (file_exists(
$dest)) {
117 $tsize = getimagesize($localimage);
119 $width = intval($tsize[0]);
120 if ($width >
$size) {
125 if ($newimg)
$location =
"$ldir/$newimg";
130 $turl = (parse_url(
$img));
134 $localimage = substr(
$path, strlen(
$dir));
138 $basedest =
"/img-cache/$size-" . basename(str_replace(
"/",
"_", $localimage)) .
".png";
145 if ($newimg)
$location =
"$ldir/$newimg";