diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2020-11-08 12:57:18 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2020-11-08 12:57:18 +0100 |
commit | aaee9a923e009ee33fad324687579ede5de7e6ce (patch) | |
tree | 18a182c4106910e541669b45bfd4290f352fbc5c /src/book.vala | |
parent | 459bdf5dc26593c96be4a3178fd5887de6ec4ded (diff) | |
parent | b29a8c77c9cb1644cdf825db552f5d7209996f82 (diff) |
Merge branch 'release/debian/3.38.1-1' into masterdebian/3.38.1-1
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; } |