destroy thumbnail image objects, and a more verbose error message
git-svn-id: file:///home/shish/svn/shimmie2/trunk@698 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
1bdfb285c1
commit
bf4a49a285
@ -15,7 +15,7 @@ class PixelFileHandler extends Extension {
|
|||||||
$hash = $event->hash;
|
$hash = $event->hash;
|
||||||
$ha = substr($hash, 0, 2);
|
$ha = substr($hash, 0, 2);
|
||||||
if(!copy($event->tmpname, "images/$ha/$hash")) {
|
if(!copy($event->tmpname, "images/$ha/$hash")) {
|
||||||
$event->veto("Pixel Handler failed to move file from uploads to archive");
|
$event->veto("Pixel Handler failed to copy file from uploads ({$event->tmpname}) to archive (images/$ha/$hash)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
|
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
|
||||||
@ -115,7 +115,9 @@ class PixelFileHandler extends Extension {
|
|||||||
private function make_thumb_gd($inname, $outname) {
|
private function make_thumb_gd($inname, $outname) {
|
||||||
global $config;
|
global $config;
|
||||||
$thumb = $this->get_thumb($inname);
|
$thumb = $this->get_thumb($inname);
|
||||||
return imagejpeg($thumb, $outname, $config->get_int('thumb_quality'));
|
$ok = imagejpeg($thumb, $outname, $config->get_int('thumb_quality'));
|
||||||
|
imagedestroy($thumb);
|
||||||
|
return $ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function get_thumb($tmpname) {
|
private function get_thumb($tmpname) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user