diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2020-09-12 11:16:32 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2020-09-12 11:16:32 +0200 |
commit | ed922abe63707106eb4024fc50046647cdf5cb3a (patch) | |
tree | a24f2db0474dcb665a6ae9a571e36363bae5150f /src/book.vala | |
parent | b5c71291fc6d07fbc16d09a8f2a374c4ac86ddf1 (diff) | |
parent | cbed9d3da4012f5e767551bb24ce16700e367381 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/book.vala')
-rw-r--r-- | src/book.vala | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/book.vala b/src/book.vala index 6db2952..798fe98 100644 --- a/src/book.vala +++ b/src/book.vala @@ -136,10 +136,10 @@ public class Book : Object return pages.index (page); } - public async void save_async (string t, int q, File f, ProgressionCallback? p, Cancellable? c) throws Error + public async void save_async (string mime_type, int quality, File file, ProgressionCallback? progress_cb, Cancellable? cancellable = null) throws Error { var book_saver = new BookSaver (); - yield book_saver.save_async (this, t, q, f, p, c); + yield book_saver.save_async (this, mime_type, quality, file, progress_cb, cancellable); } } @@ -160,7 +160,7 @@ private class BookSaver * distributes all encode tasks to other threads then yield so * the ui can continue operating. The method then return once saving * is completed, cancelled, or failed */ - public async void save_async (Book book, string type, int quality, File file, ProgressionCallback? progression_callback, Cancellable? cancellable) throws Error + public async void save_async (Book book, string mime_type, int quality, File file, ProgressionCallback? progression_callback, Cancellable? cancellable) throws Error { var timer = new Timer (); @@ -184,20 +184,20 @@ private class BookSaver /* Configure an encoder */ ThreadPoolFunc<EncodeTask>? encode_delegate = null; - switch (type) + switch (mime_type) { - case "jpeg": + case "image/jpeg": encode_delegate = encode_jpeg; break; - case "png": + case "image/png": encode_delegate = encode_png; break; #if HAVE_WEBP - case "webp": + case "image/webp": encode_delegate = encode_webp; break; #endif - case "pdf": + case "application/pdf": encode_delegate = encode_pdf; break; } @@ -205,16 +205,16 @@ private class BookSaver /* Configure a writer */ ThreadFunc<Error?>? write_delegate = null; - switch (type) + switch (mime_type) { - case "jpeg": - case "png": + case "image/jpeg": + case "image/png": #if HAVE_WEBP - case "webp": + case "image/webp": #endif write_delegate = write_multifile; break; - case "pdf": + case "application/pdf": write_delegate = write_pdf; break; } |