Blame view
sources/apps/reader/lib/thumbnail.php
825 Bytes
|
42e4f8d60
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<?php
function check_thumb_exists($location) {
$image_path = rtrim($location,'pdf').'png';
if(!file_exists('/opt/lampp/htdocs/owncloud/data/priyanka/reader'.$image_path)) {
$check = "false";
}
else
$check = "true";
return $check;
}
function thumb($path) {
$thumb_path = \OCP\Config::getSystemValue( 'datadirectory' ).'/'.\OC_User::getUser().'/reader';
if (file_exists($thumb_path.$path)) {
return new \OC_Image($thumb_path.$path);
}
if (!\OC_Filesystem::file_exists($path)) {
return false;
}
}
function check_dir_exists($current_dir,$dir) {
$owner = OCP\USER::getUser();
$path = OCP\Config::getSystemValue("datadirectory").'/'. $owner .'/reader';
$path .= $current_dir.$dir;
if (!is_dir($path)) {
mkdir($path, 0777, true);
return true;
}
else
return true;
}
?>
|