mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-10 11:02:41 +00:00
use converters
This commit is contained in:
parent
7ba956d760
commit
dc66a5959d
|
@ -76,7 +76,7 @@ class SeedDMS_Preview_Previewer {
|
||||||
);
|
);
|
||||||
$pipes = array();
|
$pipes = array();
|
||||||
|
|
||||||
$timeout += time();
|
$timeout += time();
|
||||||
$process = proc_open($cmd, $descriptorspec, $pipes);
|
$process = proc_open($cmd, $descriptorspec, $pipes);
|
||||||
if (!is_resource($process)) {
|
if (!is_resource($process)) {
|
||||||
throw new Exception("proc_open failed on: " . $cmd);
|
throw new Exception("proc_open failed on: " . $cmd);
|
||||||
|
@ -161,6 +161,10 @@ class SeedDMS_Preview_Previewer {
|
||||||
$target = $this->previewDir.$dir.md5($infile).'-'.$width;
|
$target = $this->previewDir.$dir.md5($infile).'-'.$width;
|
||||||
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
|
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
|
||||||
$cmd = '';
|
$cmd = '';
|
||||||
|
if(isset($this->converters[$mimetype])) {
|
||||||
|
$cmd = str_replace(array('%w', '%f', '%o'), array($width, $infile, $target.'.png'), $this->converters[$mimetype]);
|
||||||
|
}
|
||||||
|
/*
|
||||||
switch($mimetype) {
|
switch($mimetype) {
|
||||||
case "image/png":
|
case "image/png":
|
||||||
case "image/gif":
|
case "image/gif":
|
||||||
|
@ -180,6 +184,7 @@ class SeedDMS_Preview_Previewer {
|
||||||
$cmd = 'tar tzvf '.$infile.' | convert -density 100 -resize '.$width.'x text:-[0] '.$target.'.png';
|
$cmd = 'tar tzvf '.$infile.' | convert -density 100 -resize '.$width.'x text:-[0] '.$target.'.png';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if($cmd) {
|
if($cmd) {
|
||||||
//exec($cmd);
|
//exec($cmd);
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user