aboutsummaryrefslogtreecommitdiff
path: root/fiv.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-06-08 02:45:45 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-06-08 02:51:55 +0200
commit84f8c9436ffb84ca5d443b906f1ffb7be42a50e2 (patch)
tree5b9a614080f5b74806e7d37e7292982f9f401406 /fiv.c
parenta8f7532abdd9eade6ccc7587968e63eea3b5d159 (diff)
downloadfiv-84f8c9436ffb84ca5d443b906f1ffb7be42a50e2.tar.gz
fiv-84f8c9436ffb84ca5d443b906f1ffb7be42a50e2.tar.xz
fiv-84f8c9436ffb84ca5d443b906f1ffb7be42a50e2.zip
Downscale embedded thumbnails within minions
Otherwise the UI would become unresponsive during loading.
Diffstat (limited to 'fiv.c')
-rw-r--r--fiv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fiv.c b/fiv.c
index 9ec976c..f3ac933 100644
--- a/fiv.c
+++ b/fiv.c
@@ -1773,9 +1773,9 @@ output_thumbnail(const char *path_arg, gboolean extract, const char *size_arg)
if (!path_arg)
exit_fatal("no path given");
- FivThumbnailSize size = 0;
+ FivThumbnailSize size = FIV_THUMBNAIL_SIZE_COUNT;
if (size_arg) {
- for (; size < FIV_THUMBNAIL_SIZE_COUNT; size++) {
+ for (size = 0; size < FIV_THUMBNAIL_SIZE_COUNT; size++) {
if (!strcmp(
fiv_thumbnail_sizes[size].thumbnail_spec_name, size_arg))
break;
@@ -1787,7 +1787,7 @@ output_thumbnail(const char *path_arg, gboolean extract, const char *size_arg)
GError *error = NULL;
GFile *file = g_file_new_for_commandline_arg(path_arg);
cairo_surface_t *surface = NULL;
- if (extract && (surface = fiv_thumbnail_extract(file, &error)))
+ if (extract && (surface = fiv_thumbnail_extract(file, size, &error)))
fiv_io_serialize_to_stdout(surface, FIV_IO_SERIALIZE_LOW_QUALITY);
else if (size_arg &&
(g_clear_error(&error),