mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kioslave: scale the page size to the requested thumbnail width and height from djvucreator thumbnailer
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
2988a77e82
commit
04fd07eec7
1 changed files with 5 additions and 3 deletions
|
@ -89,14 +89,16 @@ bool DjVuCreator::create(const QString &path, int width, int height, QImage &img
|
|||
ddjvu_format_set_row_order(djvuformat, 1);
|
||||
ddjvu_format_set_y_direction(djvuformat, 1);
|
||||
|
||||
QSize pagesize(ddjvu_page_get_width(djvupage), ddjvu_page_get_height(djvupage));
|
||||
pagesize.scale(width, height, Qt::KeepAspectRatio);
|
||||
ddjvu_rect_t djvupagerect;
|
||||
djvupagerect.x = 0;
|
||||
djvupagerect.y = 0;
|
||||
djvupagerect.w = width;
|
||||
djvupagerect.h = height;
|
||||
djvupagerect.w = pagesize.width();
|
||||
djvupagerect.h = pagesize.height();
|
||||
ddjvu_rect_t djvurenderrect;
|
||||
djvurenderrect = djvupagerect;
|
||||
img = QImage(width, height, QImage::Format_RGB32);
|
||||
img = QImage(djvurenderrect.w, djvurenderrect.h, QImage::Format_RGB32);
|
||||
const int djvustatus = ddjvu_page_render(
|
||||
djvupage,
|
||||
DDJVU_RENDER_COLOR,
|
||||
|
|
Loading…
Add table
Reference in a new issue