Skip to content

Commit

Permalink
[SF#1058] Change size of large thumbnails to 512.
Browse files Browse the repository at this point in the history
256*256 appears to be small on hi-res displays.
  • Loading branch information
LStranger committed Dec 16, 2018
1 parent ad58246 commit fbff48c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Changes on 1.3.1 since 1.3.0.2:

* Fixed crash on reload while directory changes (folder might be not ready yet).

* Changed size of large thumbnails to 512 since 256*256 appears to be small on
hi-res displays.


Changes on 1.3.0.2 since 1.3.0:

Expand Down
10 changes: 5 additions & 5 deletions src/base/fm-thumbnail-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* fm-thumbnail-loader.c
*
* Copyright 2010 - 2013 Hong Jen Yee (PCMan) <[email protected]>
* Copyright 2012-2015 Andriy Grytsenko (LStranger) <[email protected]>
* Copyright 2012-2018 Andriy Grytsenko (LStranger) <[email protected]>
*
* This file is a part of the Libfm library.
*
Expand Down Expand Up @@ -822,7 +822,7 @@ static void generate_thumbnails(ThumbnailTask* task)
static GObject* scale_pix(GObject* ori_pix, int size)
{
GObject* scaled_pix;
/* keep aspect ratio and scale to thumbnail size: 128 or 256 */
/* keep aspect ratio and scale to thumbnail size: 128 or 512 */
int width = backend.get_image_width(ori_pix);
int height = backend.get_image_height(ori_pix);
int new_width;
Expand Down Expand Up @@ -1015,14 +1015,14 @@ static gboolean generate_thumbnails_with_builtin(ThumbnailTask* task)
if(task->flags & GENERATE_LARGE)
{
/* don't create thumbnails for images which are too small */
if(width <=256 && height <= 256)
if (width <= 512 && height <= 512)
{
large_pix = (GObject*)g_object_ref(ori_pix);
need_save = FALSE;
}
else
{
large_pix = scale_pix(ori_pix, 256);
large_pix = scale_pix(ori_pix, 512);
need_save = TRUE;
}
if(rotate_degrees != 0)
Expand Down Expand Up @@ -1172,7 +1172,7 @@ static void generate_thumbnails_with_thumbnailers(ThumbnailTask* task)
}
if((task->flags & GENERATE_LARGE) && !(generated & GENERATE_LARGE))
{
if(run_thumbnailer(thumbnailer, task, task->large_path, 256))
if (run_thumbnailer(thumbnailer, task, task->large_path, 512))
{
generated |= GENERATE_LARGE;
large_pix = backend.read_image_from_file(task->large_path);
Expand Down

0 comments on commit fbff48c

Please sign in to comment.