diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2023-07-09 09:46:31 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2023-07-09 10:40:32 +0200 |
commit | 840e7f172ce3b805dc5c3e4889e1166159942dc3 (patch) | |
tree | 8f99f8ae164b8039621d287ac7de7726ab9dd141 /fiv-thumbnail.c | |
parent | 9b99de99bbe2d87ee62bb72931a22f2551fa470e (diff) | |
download | fiv-840e7f172ce3b805dc5c3e4889e1166159942dc3.tar.gz fiv-840e7f172ce3b805dc5c3e4889e1166159942dc3.tar.xz fiv-840e7f172ce3b805dc5c3e4889e1166159942dc3.zip |
Colour-manage SVGs
Diffstat (limited to 'fiv-thumbnail.c')
-rw-r--r-- | fiv-thumbnail.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fiv-thumbnail.c b/fiv-thumbnail.c index 267daf7..cc0858c 100644 --- a/fiv-thumbnail.c +++ b/fiv-thumbnail.c @@ -139,6 +139,7 @@ render(GFile *target, GBytes *data, gboolean *color_managed, GError **error) { FivIoOpenContext ctx = { .uri = g_file_get_uri(target), + // Remember to synchronize changes with adjust_thumbnail(). .screen_profile = fiv_io_profile_new_sRGB(), .screen_dpi = 96, .first_frame_only = TRUE, @@ -180,8 +181,12 @@ adjust_thumbnail(FivIoImage *thumbnail, double row_height) // Vector images should not have orientation, this should handle them all. FivIoRenderClosure *closure = thumbnail->render; if (closure && orientation <= FivIoOrientation0) { + // Remember to synchronize changes with render(). + FivIoProfile screen_profile = fiv_io_profile_new_sRGB(); // This API doesn't accept non-uniform scaling; prefer a vertical fit. - FivIoImage *scaled = closure->render(closure, scale_y); + FivIoImage *scaled = closure->render(closure, screen_profile, scale_y); + if (screen_profile) + fiv_io_profile_free(screen_profile); if (scaled) return scaled; } |