27 * This file is available under and governed by the GNU General Public |
27 * This file is available under and governed by the GNU General Public |
28 * License version 2 only, as published by the Free Software Foundation. |
28 * License version 2 only, as published by the Free Software Foundation. |
29 * However, the following notice accompanied the original version of this |
29 * However, the following notice accompanied the original version of this |
30 * file and, per its terms, should not be removed: |
30 * file and, per its terms, should not be removed: |
31 * |
31 * |
32 * Last changed in libpng 1.6.32 [August 24, 2017] |
32 * Last changed in libpng 1.6.35 [July 15, 2018] |
33 * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson |
33 * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson |
34 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
34 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
35 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
35 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
36 * |
36 * |
37 * This code is released under the libpng license. |
37 * This code is released under the libpng license. |
38 * For conditions of distribution and use, see the disclaimer |
38 * For conditions of distribution and use, see the disclaimer |
393 |
393 |
394 #ifdef PNG_FIXED_POINT_SUPPORTED |
394 #ifdef PNG_FIXED_POINT_SUPPORTED |
395 static png_fixed_point |
395 static png_fixed_point |
396 png_fixed_inches_from_microns(png_const_structrp png_ptr, png_int_32 microns) |
396 png_fixed_inches_from_microns(png_const_structrp png_ptr, png_int_32 microns) |
397 { |
397 { |
398 /* Convert from metres * 1,000,000 to inches * 100,000, meters to |
398 /* Convert from meters * 1,000,000 to inches * 100,000, meters to |
399 * inches is simply *(100/2.54), so we want *(10/2.54) == 500/127. |
399 * inches is simply *(100/2.54), so we want *(10/2.54) == 500/127. |
400 * Notice that this can overflow - a warning is output and 0 is |
400 * Notice that this can overflow - a warning is output and 0 is |
401 * returned. |
401 * returned. |
402 */ |
402 */ |
403 return png_muldiv_warn(png_ptr, microns, 500, 127); |
403 return png_muldiv_warn(png_ptr, microns, 500, 127); |
767 { |
767 { |
768 png_debug1(1, "in %s retrieval function", "iCCP"); |
768 png_debug1(1, "in %s retrieval function", "iCCP"); |
769 |
769 |
770 if (png_ptr != NULL && info_ptr != NULL && |
770 if (png_ptr != NULL && info_ptr != NULL && |
771 (info_ptr->valid & PNG_INFO_iCCP) != 0 && |
771 (info_ptr->valid & PNG_INFO_iCCP) != 0 && |
772 name != NULL && compression_type != NULL && profile != NULL && |
772 name != NULL && profile != NULL && proflen != NULL) |
773 proflen != NULL) |
|
774 { |
773 { |
775 *name = info_ptr->iccp_name; |
774 *name = info_ptr->iccp_name; |
776 *profile = info_ptr->iccp_profile; |
775 *profile = info_ptr->iccp_profile; |
777 *proflen = png_get_uint_32(info_ptr->iccp_profile); |
776 *proflen = png_get_uint_32(info_ptr->iccp_profile); |
778 /* This is somewhat irrelevant since the profile data returned has |
777 /* This is somewhat irrelevant since the profile data returned has |
779 * actually been uncompressed. |
778 * actually been uncompressed. |
780 */ |
779 */ |
781 *compression_type = PNG_COMPRESSION_TYPE_BASE; |
780 if (compression_type != NULL) |
|
781 *compression_type = PNG_COMPRESSION_TYPE_BASE; |
782 return (PNG_INFO_iCCP); |
782 return (PNG_INFO_iCCP); |
783 } |
783 } |
784 |
784 |
785 return (0); |
785 return (0); |
|
786 |
786 } |
787 } |
787 #endif |
788 #endif |
788 |
789 |
789 #ifdef PNG_sPLT_SUPPORTED |
790 #ifdef PNG_sPLT_SUPPORTED |
790 int PNGAPI |
791 int PNGAPI |