mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-29 04:57:20 +00:00
take out some old code
This commit is contained in:
parent
10a8b14eff
commit
20f2d68e05
|
@ -244,60 +244,6 @@ class SeedDMS_Preview_Previewer {
|
|||
$file = $document->_dms->contentDir.$object->getPath();
|
||||
$target = $this->getFileName($object, $width);
|
||||
return $this->createRawPreview($file, $document->getDir(), $object->getMimeType(), $width, $target);
|
||||
|
||||
if($width == 0)
|
||||
$width = $this->width;
|
||||
else
|
||||
$width = intval($width);
|
||||
if(!$this->previewDir)
|
||||
return false;
|
||||
$document = $object->getDocument();
|
||||
$dir = $this->previewDir.'/'.$document->getDir();
|
||||
if(!is_dir($dir)) {
|
||||
if (!SeedDMS_Core_File::makeDir($dir)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$file = $document->_dms->contentDir.$object->getPath();
|
||||
if(!file_exists($file))
|
||||
return false;
|
||||
$target = $this->getFileName($object, $width);
|
||||
if($target !== false && (!file_exists($target.'.png') || filectime($target.'.png') < $object->getDate())) {
|
||||
$cmd = '';
|
||||
if(isset($this->converters[$object->getMimeType()])) {
|
||||
$cmd = str_replace(array('%w', '%f', '%o'), array($width, $file, $target), $this->converters[$object->getMimeType()]);
|
||||
}
|
||||
/*
|
||||
switch($object->getMimeType()) {
|
||||
case "image/png":
|
||||
case "image/gif":
|
||||
case "image/jpeg":
|
||||
case "image/jpg":
|
||||
case "image/svg+xml":
|
||||
$cmd = 'convert -resize '.$width.'x '.$file.' '.$target.'.png';
|
||||
break;
|
||||
case "application/pdf":
|
||||
case "application/postscript":
|
||||
$cmd = 'convert -density 100 -resize '.$width.'x '.$file.'[0] '.$target.'.png';
|
||||
break;
|
||||
case "text/plain":
|
||||
$cmd = 'convert -resize '.$width.'x '.$file.'[0] '.$target.'.png';
|
||||
break;
|
||||
case "application/x-compressed-tar":
|
||||
$cmd = 'tar tzvf '.$file.' | convert -density 100 -resize '.$width.'x text:-[0] '.$target.'.png';
|
||||
break;
|
||||
}
|
||||
*/
|
||||
if($cmd) {
|
||||
//exec($cmd);
|
||||
try {
|
||||
self::execWithTimeout($cmd, $this->timeout);
|
||||
} catch(Exception $e) {
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user