Files
gimp/plug-ins/file-jpeg/jpeg-icc.h
Debarshi Ray 5dcee9ad37 file-jpeg: Fix the copyright and license notices of jpeg-icc.*
This code was originally written by Thomas G. Lane and Todd Newman,
and proposed for inclusion in the Independent JPEG Group's software.
However, that fell through when Tom left the IJG. It was not written by
Marti Maria - Little cms only had a copy of that code.

This code has recently been merged into libjpeg-turbo, so it seems
reasonable to now consider libjpeg-turbo as the canonical source of
these files. However, since the GIMP carries the original version of
the code proposed for IJG's JPEG, and doesn't contain any of the more
recent and minor tweaks made during its inclusion in libjpeg-turbo,
only the original copyright holders (ie., Thomas G. Lane and Todd
Newman) are mentioned.

The relevant license text was lifted from the Independent JPEG Group's
software, similar to the way it's done in Chromium and other users of
this code.

https://gitlab.gnome.org/GNOME/gimp/issues/2119
2018-08-29 17:38:49 +02:00

51 lines
1.9 KiB
C

/* jpeg-icc.h
*
* This code was originally proposed for the Independent JPEG Group's
* software, but that fell through, and only recently got merged into
* libjpeg-turbo. This code comes with the following copyright notice:
*
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
*
* For conditions of distribution and use, see the accompanying
* COPYING.ijg file.
*/
#ifndef __JPEG_ICC_H__
#define __JPEG_ICC_H__
void jpeg_icc_write_profile (j_compress_ptr cinfo,
const guchar *icc_data_ptr,
guint icc_data_len);
/*
* Reading a JPEG file that may contain an ICC profile requires two steps:
*
* 1. After jpeg_create_decompress() but before jpeg_read_header(),
* ask the IJG library to save in memory any APP2 markers it may find
* in the file.
*
* 2. After jpeg_read_header(), call jpeg_icc_read_profile() to find
* out whether there was a profile and obtain it if so.
*
* See if there was an ICC profile in the JPEG file being read;
* if so, reassemble and return the profile data.
*
* TRUE is returned if an ICC profile was found, FALSE if not.
* If TRUE is returned, *icc_data_ptr is set to point to the
* returned data, and *icc_data_len is set to its length.
*
* IMPORTANT: the data at **icc_data_ptr has been allocated with malloc()
* and must be freed by the caller with free() when the caller no longer
* needs it. (Alternatively, we could write this routine to use the
* IJG library's memory allocator, so that the data would be freed implicitly
* at jpeg_finish_decompress() time. But it seems likely that many apps
* will prefer to have the data stick around after decompression finishes.)
*/
gboolean jpeg_icc_read_profile (j_decompress_ptr cinfo,
guchar **icc_data_ptr,
guint *icc_data_len);
#endif /* __JPEG_ICC_H__ */