Closed #33
This commit is contained in:
parent
18097b6192
commit
87eaa9ba9e
1 changed files with 14 additions and 1 deletions
|
@ -587,6 +587,16 @@ class PostController
|
||||||
$srcImage = imagecreatefromgif($srcPath);
|
$srcImage = imagecreatefromgif($srcPath);
|
||||||
break;
|
break;
|
||||||
case 'application/x-shockwave-flash':
|
case 'application/x-shockwave-flash':
|
||||||
|
$srcImage = null;
|
||||||
|
exec('which swfrender', $tmp, $exitCode);
|
||||||
|
if ($exitCode == 0)
|
||||||
|
{
|
||||||
|
$tmpPath = tempnam(sys_get_temp_dir(), 'thumb') . '.png';
|
||||||
|
exec('swfrender ' . $srcPath . ' -o ' . $tmpPath);
|
||||||
|
if (file_exists($tmpPath))
|
||||||
|
$srcImage = imagecreatefrompng($tmpPath);
|
||||||
|
}
|
||||||
|
if (!$srcImage)
|
||||||
$path = $this->config->main->mediaPath . DS . 'img' . DS . 'thumb-swf.png';
|
$path = $this->config->main->mediaPath . DS . 'img' . DS . 'thumb-swf.png';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -620,6 +630,9 @@ class PostController
|
||||||
$this->context->transport->mimeType = 'image/png';
|
$this->context->transport->mimeType = 'image/png';
|
||||||
$this->context->transport->fileHash = 'thumb' . $post->file_hash;
|
$this->context->transport->fileHash = 'thumb' . $post->file_hash;
|
||||||
$this->context->transport->filePath = $path;
|
$this->context->transport->filePath = $path;
|
||||||
|
|
||||||
|
if (isset($tmpPath))
|
||||||
|
unlink($tmpPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue