add commands for make previews of tar.gz, .ps, .txt

This commit is contained in:
Uwe Steinmann 2014-03-18 10:04:12 +01:00
parent d87296c859
commit fecc6d2804

View File

@ -98,13 +98,22 @@ class SeedDMS_Preview_Previewer {
case "image/gif":
case "image/jpeg":
case "image/jpg":
case "image/svg+xml":
$cmd = 'convert -resize '.$width.'x'.$width.' '.$file.' '.$target;
break;
case "application/pdf":
case "application/postscript":
$cmd = 'convert -density 18 -resize '.$width.'x'.$width.' '.$file.'[0] '.$target;
break;
case "text/plain":
$cmd = 'convert -resize '.$width.'x'.$width.' '.$file.'[0] '.$target;
break;
case "application/x-compressed-tar":
$cmd = 'tar tzvf '.$file.' | convert -resize '.$width.'x'.$width.' text:-[0] '.$target;
break;
}
if($cmd) {
system( $cmd);
exec($cmd);
}
return true;
}