From 4f035bc6b1aa81b4be90df83e02235bde5c0ad5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Tue, 14 Dec 2021 05:03:55 +0100 Subject: Allow saving the current frame/page in WebP Also support saving just the metadata. --- fastiv-io.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'fastiv-io.h') diff --git a/fastiv-io.h b/fastiv-io.h index c8a256b..a581ea8 100644 --- a/fastiv-io.h +++ b/fastiv-io.h @@ -1,5 +1,5 @@ // -// fastiv-io.h: image loaders +// fastiv-io.h: image operations // // Copyright (c) 2021, Přemysl Eric Janouch // @@ -59,6 +59,13 @@ cairo_surface_t *fastiv_io_open_from_data( int fastiv_io_filecmp(GFile *f1, GFile *f2); +// --- Export ------------------------------------------------------------------ + +/// Requires libwebp. +/// If no exact frame is specified, this potentially creates an animation. +gboolean fastiv_io_save(cairo_surface_t *page, cairo_surface_t *frame, + const gchar *path, GError **error); + // --- Metadata ---------------------------------------------------------------- // https://www.cipa.jp/std/documents/e/DC-008-2012_E.pdf Table 6 @@ -76,6 +83,10 @@ typedef enum _FastivIoOrientation { FastivIoOrientation fastiv_io_exif_orientation(const guint8 *exif, gsize len); +/// Save metadata attached by this module in Exiv2 format. +gboolean fastiv_io_save_metadata( + cairo_surface_t *page, const gchar *path, GError **error); + // --- Thumbnails -------------------------------------------------------------- // And this is how you avoid glib-mkenums. -- cgit v1.2.3