summaryrefslogtreecommitdiff
path: root/pngerror.c
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2012-10-25 19:30:02 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2012-10-25 19:30:02 -0500
commitf8dfd123e2b337f0ce3c484bbcfec10c4c8daddc (patch)
tree104fc10e92f7852a2c5131a308b1449d88997828 /pngerror.c
parente6b710cb3fc573688c2150f9b777156f5d053518 (diff)
downloadlibpng-f8dfd123e2b337f0ce3c484bbcfec10c4c8daddc.tar.gz
[libpng16] Changed ICC profile support to allow use of an external color
management system (CMS). In practice it is not possible to obtain cHRM information reliably using just the end-point tags because they do not exist in the vast majority of profiles. Instead it is necessary to run the endpoints through the ICC colorimetric intent transform (as described in the v4 spec). Since this is likely to be too much code inside libpng for too little gain (it implies a fairly complete CMS implementation) the code has been changed to allow an external CMS to be used. This code is temporarily disabled until a suitable set of test cases using one or more external CMS implementations have been implemented.
Diffstat (limited to 'pngerror.c')
-rw-r--r--pngerror.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/pngerror.c b/pngerror.c
index dbc6534ba..a97778b3c 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -510,6 +510,41 @@ png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp
#endif
#endif /* PNG_READ_SUPPORTED */
+void /* PRIVATE */
+png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
+{
+ /* This is always supported, but for just read or just write it
+ * unconditionally does the right thing.
+ */
+# if (defined PNG_READ_SUPPORTED) && (defined PNG_WRITE_SUPPORTED)
+ if (png_ptr->mode & PNG_IS_READ_STRUCT)
+# endif
+
+# ifdef PNG_READ_SUPPORTED
+ {
+ if (error < PNG_CHUNK_ERROR)
+ png_chunk_warning(png_ptr, message);
+
+ else
+ png_chunk_benign_error(png_ptr, message);
+ }
+# endif
+
+# if (defined PNG_READ_SUPPORTED) && (defined PNG_WRITE_SUPPORTED)
+ else if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
+# endif
+
+# ifdef PNG_WRITE_SUPPORTED
+ {
+ if (error < PNG_CHUNK_WRITE_ERROR)
+ png_app_warning(png_ptr, message);
+
+ else
+ png_app_error(png_ptr, message);
+ }
+# endif
+}
+
#ifdef PNG_ERROR_TEXT_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_FUNCTION(void,