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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user