From f3947006fb98c72d06b52c36317585d757cc984c Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sat, 1 Oct 2016 12:54:47 +0800 Subject: Open document file in fz_open_document(). This relieves all document formats from reimplementing opening a fz_stream unless the format wants to do something more than just opening the raw file. --- source/cbz/muimg.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'source/cbz/muimg.c') diff --git a/source/cbz/muimg.c b/source/cbz/muimg.c index 5292c365..1f181cab 100644 --- a/source/cbz/muimg.c +++ b/source/cbz/muimg.c @@ -131,24 +131,6 @@ img_open_document_with_stream(fz_context *ctx, fz_stream *stm) return doc; } -static img_document * -img_open_document(fz_context *ctx, const char *filename) -{ - fz_stream *stm; - img_document *doc; - - stm = fz_open_file(ctx, filename); - - fz_try(ctx) - doc = img_open_document_with_stream(ctx, stm); - fz_always(ctx) - fz_drop_stream(ctx, stm); - fz_catch(ctx) - fz_rethrow(ctx); - - return doc; -} - static int img_recognize(fz_context *doc, const char *magic) { @@ -192,6 +174,6 @@ img_recognize(fz_context *doc, const char *magic) fz_document_handler img_document_handler = { (fz_document_recognize_fn *)&img_recognize, - (fz_document_open_fn *)&img_open_document, + (fz_document_open_fn *)NULL, (fz_document_open_with_stream_fn *)&img_open_document_with_stream }; -- cgit v1.2.3