diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-04-14 11:53:53 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-04-14 16:13:58 +0100 |
commit | a7be4a1caca767baa0ce0946792f3c3e9e150308 (patch) | |
tree | 76804ec000992a20fdf62bf962ef06df6750a0e8 /source/cbz/muimg.c | |
parent | 1bc74dac2b251764d373c164e2b5235875f27901 (diff) | |
download | mupdf-a7be4a1caca767baa0ce0946792f3c3e9e150308.tar.xz |
Split fz_meta into separate querying functions.
Add fz_has_permission function to fz_document.
Add fz_lookup_metadata function to fz_document.
Remove fz_meta function from fz_document.
Diffstat (limited to 'source/cbz/muimg.c')
-rw-r--r-- | source/cbz/muimg.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/cbz/muimg.c b/source/cbz/muimg.c index 169fec95..ac6997ee 100644 --- a/source/cbz/muimg.c +++ b/source/cbz/muimg.c @@ -82,16 +82,11 @@ img_load_page(fz_context *ctx, img_document *doc, int number) } static int -img_meta(fz_context *ctx, img_document *doc, int key, void *ptr, int size) +img_lookup_metadata(fz_context *ctx, img_document *doc, const char *key, char *buf, int size) { - switch(key) - { - case FZ_META_FORMAT_INFO: - sprintf((char *)ptr, "IMAGE"); - return FZ_META_OK; - default: - return FZ_META_UNKNOWN_KEY; - } + if (!strcmp(key, "format")) + return fz_strlcpy(buf, "Image", size); + return -1; } static img_document * @@ -102,7 +97,7 @@ img_new_document(fz_context *ctx, fz_image *image) doc->super.close = (fz_document_close_fn *)img_close_document; doc->super.count_pages = (fz_document_count_pages_fn *)img_count_pages; doc->super.load_page = (fz_document_load_page_fn *)img_load_page; - doc->super.meta = (fz_document_meta_fn *)img_meta; + doc->super.lookup_metadata = (fz_document_lookup_metadata_fn *)img_lookup_metadata; doc->image = fz_keep_image(ctx, image); |