added a special thread for making thumbnails (thumb.h thumb.cpp)

git-svn-id: svn://ttmath.org/publicrep/winix/trunk@700 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-12-11 22:55:48 +00:00
parent e854fe3681
commit 5d09eb149c
39 changed files with 706 additions and 289 deletions

View File

@@ -7,7 +7,6 @@
*
*/
#include "wand/MagickWand.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <cstdio>
@@ -73,23 +72,7 @@ void Upload::CreateThumbnail(const Item & item)
!system->MakeFilePath(item, path_thumb, true, true, config->upload_dirs_chmod) )
return;
Ezc::WideToUTF8(path, patha);
Ezc::WideToUTF8(path_thumb, path_thumba);
MagickWand * wand = NewMagickWand();
if( MagickReadImage(wand, patha.c_str()) )
{
//log <<log1 << "images: " << MagickGetNumberImages(wand) << logend << logsavenow;
//MagickResizeImage(wand, config->images_thumb_cx, config->images_thumb_cy, CubicFilter, 0.25);
//MagickScaleImage(wand, 100, 100);
MagickThumbnailImage(wand, config->thumb_cx, config->thumb_cy);
if( MagickWriteImage(wand, path_thumba.c_str()) )
log << log3 << "Upload: created a thumbnail: " << path_thumba << logend;
}
DestroyMagickWand(wand);
system->thumb.CreateThumb(item.id, path, path_thumb, config->thumb_cx, config->thumb_cy, config->thumb_mode);
}