diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-10-16 14:11:26 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2017-10-24 15:16:36 +0100 |
commit | a336a599666e34a438852d22d068a2267465376e (patch) | |
tree | 39ef9cfeb1da62d28dddb3ed150a8b1daa69422d /source/fitz/colorspace.c | |
parent | f2e0ab5afee63d9f446f37201291010e68282cc4 (diff) | |
download | mupdf-a336a599666e34a438852d22d068a2267465376e.tar.xz |
Make a public fz_new_icc_colorspace_from_file function.
Diffstat (limited to 'source/fitz/colorspace.c')
-rw-r--r-- | source/fitz/colorspace.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c index da4a4f29..17892256 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -3701,6 +3701,19 @@ fz_new_icc_colorspace(fz_context *ctx, const char *name, int num, fz_buffer *buf return cs; } +fz_colorspace *fz_new_icc_colorspace_from_file(fz_context *ctx, const char *name, const char *path) +{ + fz_colorspace *cs = NULL; + fz_buffer *buffer = fz_read_file(ctx, path); + fz_try(ctx) + cs = fz_new_icc_colorspace(ctx, name, 0, buffer); + fz_always(ctx) + fz_drop_buffer(ctx, buffer); + fz_catch(ctx) + fz_rethrow(ctx); + return cs; +} + /* Gets the icc data from a color space. Used in the writing out of the icc * data for output formats. */ |