3
* This code was originally copied from the jpegicc tool as found in
4
* the lcms source code. This code comes with the following copyright
8
* Copyright (C) 1998-2004 Marti Maria
10
* Permission is hereby granted, free of charge, to any person
11
* obtaining a copy of this software and associated documentation
12
* files (the "Software"), to deal in the Software without
13
* restriction, including without limitation the rights to use, copy,
14
* modify, merge, publish, distribute, sublicense, and/or sell copies
15
* of the Software, and to permit persons to whom the Software is
16
* furnished to do so, subject to the following conditions:
18
* The above copyright notice and this permission notice shall be
19
* included in all copies or substantial portions of the Software.
22
void jpeg_icc_write_profile (j_compress_ptr cinfo,
23
const guchar *icc_data_ptr,
28
* Reading a JPEG file that may contain an ICC profile requires two steps:
30
* 1. After jpeg_create_decompress() but before jpeg_read_header(),
31
* call jpeg_icc_setup_read_profile(). This routine tells the IJG
32
* library to save in memory any APP2 markers it may find in the
35
* 2. After jpeg_read_header(), call jpeg_icc_read_profile() to find
36
* out whether there was a profile and obtain it if so.
41
* Prepare for reading an ICC profile
44
void jpeg_icc_setup_read_profile (j_decompress_ptr cinfo);
48
* See if there was an ICC profile in the JPEG file being read;
49
* if so, reassemble and return the profile data.
51
* TRUE is returned if an ICC profile was found, FALSE if not.
52
* If TRUE is returned, *icc_data_ptr is set to point to the
53
* returned data, and *icc_data_len is set to its length.
55
* IMPORTANT: the data at **icc_data_ptr has been allocated with malloc()
56
* and must be freed by the caller with free() when the caller no longer
57
* needs it. (Alternatively, we could write this routine to use the
58
* IJG library's memory allocator, so that the data would be freed implicitly
59
* at jpeg_finish_decompress() time. But it seems likely that many apps
60
* will prefer to have the data stick around after decompression finishes.)
63
gboolean jpeg_icc_read_profile (j_decompress_ptr cinfo,
64
guchar **icc_data_ptr,