added: mount options: thumb_size(cx, cy)
size of a generated thumbnail (size in pixels) added: plugin gallery: mount option gallery_type it can be: "lightbox" "galleria" "galleriathumb" git-svn-id: svn://ttmath.org/publicrep/winix/trunk@717 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -89,6 +89,40 @@ bool Upload::UploadSaveStaticFile(const Item & item, const std::wstring & tmp_fi
|
||||
}
|
||||
|
||||
|
||||
void Upload::CreateThumb(Item & item)
|
||||
{
|
||||
Mount & m = *system->mounts.pmount;
|
||||
size_t cx = config->thumb_cx;
|
||||
size_t cy = config->thumb_cy;
|
||||
int mode = config->thumb_mode;
|
||||
int index;
|
||||
|
||||
// reading width and height from then mount point (if exists)
|
||||
index = system->mounts.MountParThumbSize();
|
||||
|
||||
if( m.param[index].defined && m.param[index].arg.size() == 2 )
|
||||
{
|
||||
cx = Tol(m.param[index].arg[0]);
|
||||
cy = Tol(m.param[index].arg[1]);
|
||||
}
|
||||
|
||||
if( cx > 2000 )
|
||||
cx = 2000;
|
||||
|
||||
if( cy > 2000 )
|
||||
cy = 2000;
|
||||
|
||||
// reading thumb mode from then mount point (if exists)
|
||||
index = system->mounts.MountParThumbMode();
|
||||
|
||||
if( m.param[index].defined && m.param[index].arg.size() == 1 )
|
||||
mode = Toi(m.param[index].arg[0]);
|
||||
|
||||
system->thumb.CreateThumb(item, cx, cy, mode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Upload::UploadFile(Item & item, const std::wstring & tmp_filename)
|
||||
{
|
||||
// we should add the file beforehand to get the proper item.id
|
||||
@@ -103,7 +137,7 @@ void Upload::UploadFile(Item & item, const std::wstring & tmp_filename)
|
||||
cur->request->status = db->EditFileById(item, item.id);
|
||||
|
||||
if( item.file_type == WINIX_ITEM_FILETYPE_IMAGE && config->create_thumb )
|
||||
system->thumb.CreateThumb(item, config->thumb_cx, config->thumb_cy, config->thumb_mode);
|
||||
CreateThumb(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user