Name: image/library/libpng16 Summary: Portable Network Graphics library version 1.6 Publisher: solaris Version: 1.6.51 Build Release: 11.4 Branch: 11.4.90.0.0.212.0 Packaging Date: Wed Dec 17 20:27:28 2025 Size: 2.30 MB Compressed Size: 943.96 kB FMRI: pkg://solaris/image/library/libpng16@1.6.51,11.4-11.4.90.0.0.212.0:20251217T202728Z License: ## Files: LICENSE COPYRIGHT NOTICE, DISCLAIMER, and LICENSE ========================================= PNG Reference Library License version 2 --------------------------------------- * Copyright (c) 1995-2025 The PNG Reference Library Authors. * Copyright (c) 2018-2025 Cosmin Truta. * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. * Copyright (c) 1996-1997 Andreas Dilger. * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. The software is supplied "as is", without warranty of any kind, express or implied, including, without limitation, the warranties of merchantability, fitness for a particular purpose, title, and non-infringement. In no event shall the Copyright owners, or anyone distributing the software, be liable for any damages or other liability, whether in contract, tort or otherwise, arising from, out of, or in connection with the software, or the use or other dealings in the software, even if advised of the possibility of such damage. Permission is hereby granted to use, copy, modify, and distribute this software, or portions hereof, for any purpose, without fee, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated, but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This Copyright notice may not be removed or altered from any source or altered source distribution. PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) ----------------------------------------------------------------------- libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are derived from libpng-1.0.6, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors: Simon-Pierre Cadieux Eric S. Raymond Mans Rullgard Cosmin Truta Gilles Vollant James Yu Mandar Sahastrabuddhe Google Inc. Vadim Barkov and with the following additions to the disclaimer: There is no warranty against interference with your enjoyment of the library or against infringement. There is no warranty that our efforts or the library will fulfill any of your particular purposes or needs. This library is provided with all faults, and the entire risk of satisfactory quality, performance, accuracy, and effort is with the user. Some files in the "contrib" directory and some configure-generated files that are distributed with libpng have other copyright owners, and are released under other open source licenses. libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from libpng-0.96, and are distributed according to the same disclaimer and license as libpng-0.96, with the following individuals added to the list of Contributing Authors: Tom Lane Glenn Randers-Pehrson Willem van Schaik libpng versions 0.89, June 1996, through 0.96, May 1997, are Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, and are distributed according to the same disclaimer and license as libpng-0.88, with the following individuals added to the list of Contributing Authors: John Bowler Kevin Bracey Sam Bushell Magnus Holmgren Greg Roelofs Tom Tanner Some files in the "scripts" directory have other copyright owners, but are released under this license. libpng versions 0.5, May 1995, through 0.88, January 1996, are Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. For the purposes of this copyright and license, "Contributing Authors" is defined as the following set of individuals: Andreas Dilger Dave Martindale Guy Eric Schalnat Paul Schmidt Tim Wegner The PNG Reference Library is supplied "AS IS". The Contributing Authors and Group 42, Inc. disclaim all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The Contributing Authors and Group 42, Inc. assume no liability for direct, indirect, incidental, special, exemplary, or consequential damages, which may result from the use of the PNG Reference Library, even if advised of the possibility of such damage. Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, for any purpose, without fee, subject to the following restrictions: 1. The origin of this source code must not be misrepresented. 2. Altered versions must be plainly marked as such and must not be misrepresented as being the original source. 3. This Copyright notice may not be removed or altered from any source or altered source distribution. The Contributing Authors and Group 42, Inc. specifically permit, without fee, and encourage the use of this source code as a component to supporting the PNG file format in commercial products. If you use this source code in a product, acknowledgment is not required but would be appreciated. ## Files: contrib/pngminus/LICENSE.txt pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file copyright (C) 1999-2019 by Willem van Schaik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. ## Files: AUTHORS PNG REFERENCE LIBRARY AUTHORS ============================= This is the list of PNG Reference Library ("libpng") Contributing Authors, for copyright and licensing purposes. * Adam Richter * Andreas Dilger * Chris Blume * Cosmin Truta * Dave Martindale * Eric S. Raymond * Gilles Vollant * Glenn Randers-Pehrson * Greg Roelofs * Guy Eric Schalnat * James Yu * John Bowler * Kevin Bracey * Lucas Chollet * Magnus Holmgren * Mandar Sahastrabuddhe * Manfred Schlaegl * Mans Rullgard * Matt Sarett * Mike Klein * Pascal Massimino * Paul Schmidt * Philippe Antoine * Qiang Zhou * Sam Bushell * Samuel Williams * Simon-Pierre Cadieux * Tim Wegner * Tom Lane * Tom Tanner * Vadim Barkov * Willem van Schaik * Zhijie Liang * Apple Inc. - Zixu Wang (王子旭) * Arm Holdings - Richard Townsend * Google LLC - Dan Field - Dragoș Tiselice - Leon Scroggins III - Matt Sarett - Mike Klein - Sami Boukortt - Wan-Teh Chang * Loongson Technology Corporation Ltd. - GuXiWei (顾希伟) - JinBo (金波) - ZhangLixia (张利霞) * Samsung Group - Filip Wasil The build projects, the build scripts, the test scripts, and other files in the "projects", "scripts" and "tests" directories, have other copyright owners, but are released under the libpng license. Some files in the "ci" and "contrib" directories, as well as some of the tools-generated files that are distributed with libpng, have other copyright owners, and are released under other open source licenses. ## Files: ci/README.md Scripts for the Continuous Integration of the PNG Reference Library =================================================================== Copyright Notice ---------------- Copyright (c) 2019-2025 Cosmin Truta. Use, modification and distribution are subject to the MIT License. Please see the accompanying file `LICENSE_MIT.txt` or visit https://opensource.org/license/mit File List --------- LICENSE_MIT.txt ==> The License file README.md ==> This file ci_lint.sh ==> Lint the source code ci_shellify.sh ==> Convert select definitions to shell syntax ci_verify_cmake.sh ==> Verify the build driven by CMakeLists.txt ci_verify_configure.sh ==> Verify the build driven by configure ci_verify_makefiles.sh ==> Verify the build driven by scripts/makefile.* ci_verify_version.sh ==> Verify the consistency of version definitions lib/ci.lib.sh ==> Shell utilities for the main ci_*.sh scripts targets/*/ci_env.*.sh ==> Shell environments for cross-platform testing ## Files: contrib/examples/README.txt This directory (contrib/examples) contains examples of libpng usage. NO COPYRIGHT RIGHTS ARE CLAIMED TO ANY OF THE FILES IN THIS DIRECTORY. To the extent possible under law, the authors have waived all copyright and related or neighboring rights to this work. This work is published from: United States. The files may be used freely in any way. The intention is that appropriate parts of the files be used in other libpng-using programs without any need for the authors of the using code to seek copyright or license from the original authors. The source code and comments in this directory are the original work of the people named below. No other person or organization has made contributions to the work in this directory. ORIGINAL AUTHORS The following people have contributed to the code in this directory. None of the people below claim any rights with regard to the contents of this directory. John Bowler ## Files: contrib/gregbook/COPYING GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ## Files: contrib/gregbook/LICENSE --------------------------------------------------------------------------- Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------- ## Files: contrib/oss-fuzz/README.txt Copyright (c) 2017 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Files in this directory are used by the oss-fuzz project (https://github.com/google/oss-fuzz/tree/master/projects/libpng). for "fuzzing" libpng. They were licensed by Google Inc, using the BSD-like Chromium license, which may be found at https://cs.chromium.org/chromium/src/LICENSE, or, if noted in the source, under the Apache-2.0 license, which may be found at http://www.apache.org/licenses/LICENSE-2.0 . If they have been modified, the derivatives are copyright Glenn Randers-Pehrson and are released under the same licenses as the originals. Several of the original files (libpng_read_fuzzer.options, png.dict, project.yaml) had no licensing information; we assumed that these were under the Chromium license. Any new files are released under the libpng license (see png.h). The files are Original Filename or derived Copyright License ========================= ========== ================ ========== Dockerfile* derived 2017, Glenn R-P Apache 2.0 build.sh derived 2017, Glenn R-P Apache 2.0 libpng_read_fuzzer.cc derived 2017, Glenn R-P Chromium libpng_read_fuzzer.options original 2015, Chrome Devs Chromium png.dict original 2015, Chrome Devs Chromium README.txt (this file) original 2017, Glenn R-P libpng * Dockerfile is a copy of the file used by oss-fuzz. build.sh, png.dict and libpng_read_fuzzer.* are the actual files used by oss-fuzz, which retrieves them from the libpng repository at Github. To do: exercise the progressive reader and the png encoder. ## Files: contrib/pngminus/README.txt PngMinus -------- (copyright Willem van Schaik, 1999-2019) Some history ------------ Soon after the creation of PNG in 1995, the need was felt for a set of pnmtopng / pngtopnm utilities. Independently Alexander Lehmann and I (Willem van Schaik) started such a project. Luckily we discovered this and merged the two, which later became part of NetPBM, available from SourceForge. These two utilities have many, many options and make use of most of the features of PNG, like gamma, alpha, sbit, text-chunks, etc. This makes the utilities quite complex and by now not anymore very maintainable. When we wrote these programs, libpng was still in an early stage. Therefore, lots of the functionality that we put in our software can now be done using transform-functions in libpng. Finally, to compile these programs, you need to have installed and compiled three libraries: libpng, zlib and netpbm. Especially the latter makes the whole setup a bit bulky. But that's unavoidable given the many features of pnmtopng. What now (1999) --------------- At this moment libpng is in a very stable state and can do much of the work done in pnmtopng. Also, pnmtopng needs to be upgraded to the new interface of libpng. Hence, it is time for a rewrite from the ground up of pnmtopng and pngtopnm. This will happen in the near future (stay tuned). The new package will get a different name to distinguish it from the old one: PngPlus. To experiment a bit with the new interface of libpng, I started off with a small prototype that contains only the basic functionality. It doesn't have any of the options to read or write special chunks and it will do no gamma correction. But this makes it also a simple program that is quite easy to understand and can serve well as a template for other software developments. By now there are of course a couple of programs, like Greg Roelofs' rpng/wpng, that can be used just as good. Can and can not --------------- As this is the small brother of the future PngPlus, I called this fellow PngMinus. Because I started this development in good-old Turbo-C, I avoided the use the netpbm library, which requires DOS extenders. Again, another reason to call it PngMinus (minus netpbm :-). So, part of the program are some elementary routines to read / write pgm- and ppm-files. It does not handle B&W pbm-files, but instead you could do pgm with bit- depth 1. The downside of this approach is that you can not use them on images that require blocks of memory bigger than 64k (the DOS version). For larger images you will get an out-of-memory error. As said before, PngMinus doesn't correct for gamma. When reading png-files you can do this just as well by piping the output of png2pnm to pnmgamma, one of the standard PbmPlus tools. This same scenario will most probably also be followed in the full-blown future PngPlus, with the addition of course of the possibility to create gamma-chunks when writing png-files. On the other hand it supports alpha-channels. When reading a png-image you can write the alpha-channel into a pgm-file. And when creating an RGB+A png-image, you just combine a ppm-file with a corresponding pgm-file containing the alpha-channel. When reading, transparency chunks are converted into an alpha-channel and from there on treated the same way. Finally you can opt for writing ascii or binary pgm- and ppm-files. When the bit-depth is 16, the format will always be ascii. Using it -------- To distinguish them from pnmtopng and PngPlus, the utilities are named png2pnm and pnm2png (2 instead of to). The input- and output-files can be given as parameters or through redirection. Therefore the programs can be part of a pipe. To list the options type "png2pnm -h" or "pnm2png -h". Just like Scandinavian furniture -------------------------------- You have to put it together yourself. I developed the software on MS-DOS with Turbo-C 3.0 and RedHat Linux 4.2 with gcc. In both cases I used libpng-1.0.4 and zlib-1.1.3. By now (2019) it is twenty years later and more current versions are OK. The makefile assumes that the libpng libraries can be found in ../.. and libz in ../../../zlib. But you can change this to for example ../libpng and ../zlib. The makefile creates two versions of each program, one with static library support and the other using shared libraries. If you create a ../pngsuite directory and then store the basn####.png files from PngSuite (http://www.schaik.com/pngsuite/) in there, you can test the proper functioning of PngMinus by running pngminus.sh. Warranty ------- Please, remember that this was just a small experiment to learn a few things. It will have many unforeseen features ... who said bugs? Use it when you are in need for something simple or when you want a starting point for developing your own stuff. The end ------- Willem van Schaik mailto:willem at schaik dot com http://www.schaik.com/png/ Oct 1999, Jan 2019 ## Files: contrib/pngsuite/README pngsuite -------- Copyright (c) Willem van Schaik, 1999, 2011, 2012 Two images (ftbbn0g01.png and ftbbn0g02.png) are by Glenn Randers-Pehrson, 2012 Permission to use, copy, modify, and distribute these images for any purpose and without fee is hereby granted. The 15 "bas*.png" images are part of the much larger PngSuite test-set of images, available for developers of PNG supporting software. The complete set, available at http:/www.schaik.com/pngsuite/, contains a variety of images to test interlacing, gamma settings, ancillary chunks, etc. The "ft*.png" images are "free/libre" replacements for the transparent corresponding t*.png images in the PngSuite. The "i*.png" images are the same images, but interlaced. The images in this directory represent the basic PNG color-types: grayscale (1-16 bit deep), full color (8 or 16 bit), paletted (1-8 bit) and grayscale or color images with alpha channel. You can use them to test the proper functioning of PNG software. filename depth type ------------ ------ -------------- basn0g01.png 1-bit grayscale basn0g02.png 2-bit grayscale basn0g04.png 4-bit grayscale basn0g08.png 8-bit grayscale basn0g16.png 16-bit grayscale basn2c08.png 8-bit truecolor basn2c16.png 16-bit truecolor basn3p01.png 1-bit paletted basn3p02.png 2-bit paletted basn3p04.png 4-bit paletted basn3p08.png 8-bit paletted basn4a08.png 8-bit gray with alpha basn4a16.png 16-bit gray with alpha basn6a08.png 8-bit RGBA basn6a16.png 16-bit RGBA ftbbn0g01.png 1-bit grayscale, black bKGD ftbbn0g02.png 2-bit grayscale, black bKGD ftbbn0g04.png 4-bit grayscale, black bKGD ftbbn2c16.png 16-bit truecolor, black bKGD ftbbn3p08.png 8-bit paletted, black bKGD ftbgn2c16.png 16-bit truecolor, gray bKGD ftbgn3p08.png 8-bit paletted, gray bKGD ftbrn2c08.png 8-bit truecolor, red bKGD ftbwn0g16.png 16-bit gray, white bKGD ftbwn3p08.png 8-bit paletted, white bKGD ftbyn3p08.png 8-bit paletted, yellow bKGD ftp0n0g08.png 8-bit grayscale, opaque ftp0n2c08.png 8-bit truecolor, opaque ftp0n3p08.png 8-bit paletted, opaque ftp1n3p08.png 8-bit paletted, no bKGD Here is the correct result of typing "pngtest -m bas*.png" in this directory: Testing basn0g01.png: PASS (524 zero samples) Filter 0 was used 32 times Testing basn0g02.png: PASS (448 zero samples) Filter 0 was used 32 times Testing basn0g04.png: PASS (520 zero samples) Filter 0 was used 32 times Testing basn0g08.png: PASS (3 zero samples) Filter 1 was used 9 times Filter 4 was used 23 times Testing basn0g16.png: PASS (1 zero samples) Filter 1 was used 1 times Filter 2 was used 31 times Testing basn2c08.png: PASS (6 zero samples) Filter 1 was used 5 times Filter 4 was used 27 times Testing basn2c16.png: PASS (592 zero samples) Filter 1 was used 1 times Filter 4 was used 31 times Testing basn3p01.png: PASS (512 zero samples) Filter 0 was used 32 times Testing basn3p02.png: PASS (448 zero samples) Filter 0 was used 32 times Testing basn3p04.png: PASS (544 zero samples) Filter 0 was used 32 times Testing basn3p08.png: PASS (4 zero samples) Filter 0 was used 32 times Testing basn4a08.png: PASS (32 zero samples) Filter 1 was used 1 times Filter 4 was used 31 times Testing basn4a16.png: PASS (64 zero samples) Filter 0 was used 1 times Filter 1 was used 2 times Filter 2 was used 1 times Filter 4 was used 28 times Testing basn6a08.png: PASS (160 zero samples) Filter 1 was used 1 times Filter 4 was used 31 times Testing basn6a16.png: PASS (1072 zero samples) Filter 1 was used 4 times Filter 4 was used 28 times libpng passes test Willem van Schaik October 1999 ## Files: contrib/tools/README.txt This directory (contrib/tools) contains tools used by the authors of libpng. Code and data placed in this directory is not required to build libpng, however the code in this directory has been used to generate data or code in the body of the libpng source. The source code identifies where this has been done. Code in this directory may not compile on all operating systems that libpng supports. NO COPYRIGHT RIGHTS ARE CLAIMED TO ANY OF THE FILES IN THIS DIRECTORY. To the extent possible under law, the authors have waived all copyright and related or neighboring rights to this work. This work is published from: United States. The files may be used freely in any way. The source code and comments in this directory are the original work of the people named below. No other person or organization has made contributions to the work in this directory. ORIGINAL AUTHORS The following people have contributed to the code in this directory. None of the people below claim any rights with regard to the contents of this directory. John Bowler Glenn Randers-Pehrson ## Files: contrib/visupng/README.txt Microsoft Developer Studio Build File, Format Version 6.00 for VisualPng ------------------------------------------------------------------------ Copyright 2000, Willem van Schaik. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h As a PNG .dll demo VisualPng is finished. More features would only hinder the program's objective. However, further extensions (like support for other graphics formats) are in development. To get these, or for pre-compiled binaries, go to "http://www.schaik.com/png/visualpng.html". ------------------------------------------------------------------------ Assumes that libpng DLLs and LIBs are in ..\..\projects\msvc\win32\libpng zlib DLLs and LIBs are in ..\..\projects\msvc\win32\zlib libpng header files are in ..\..\..\libpng zlib header files are in ..\..\..\zlib the pngsuite images are in ..\pngsuite To build: 1) On the main menu Select "Build|Set Active configuration". Choose the configuration that corresponds to the library you want to test. This library must have been built using the libpng MS project located in the "..\..\mscv" subdirectory. 2) Select "Build|Clean" 3) Select "Build|Rebuild All" 4) After compiling and linking VisualPng will be started to view an image from the PngSuite directory. Press Ctrl-N (and Ctrl-V) for other images. To install: When distributing VisualPng (or a further development) the following options are available: 1) Build the program with the configuration "Win32 LIB" and you only need to include the executable from the ./lib directory in your distribution. 2) Build the program with the configuration "Win32 DLL" and you need to put in your distribution the executable from the ./dll directory and the dll's libpng1.dll, zlib.dll and msvcrt.dll. These need to be in the user's PATH. Willem van Schaik Calgary, June 6th 2000 P.S. VisualPng was written based on preliminary work of: - Simon-Pierre Cadieux - Glenn Randers-Pehrson - Greg Roelofs ## Files: projects/visualc71/README.txt Microsoft Developer Studio Project File, Format Version 7.10 for libpng. Copyright (C) 2004 Simon-Pierre Cadieux. This code is released under the libpng license. For conditions of distribution and use, see copyright notice in png.h NOTE: This project will be removed from libpng-1.5.0. It has been replaced with the "vstudio" project. Assumptions: * The libpng source files are in ..\.. * The zlib source files are in ..\..\..\zlib * The zlib project file is in . /* Warning: This is until the zlib project files get integrated into the next zlib release. The final zlib project directory will then be ..\..\..\zlib\projects\visualc71. */ To use: 1) On the main menu, select "File | Open Solution". Open "libpng.sln". 2) Display the Solution Explorer view (Ctrl+Alt+L) 3) Set one of the project as the StartUp project. If you just want to build the binaries set "libpng" as the startup project (Select "libpng" tree view item + Project | Set as StartUp project). If you want to build and test the binaries set it to "pngtest" (Select "pngtest" tree view item + Project | Set as StartUp project) 4) Select "Build | Configuration Manager...". Choose the configuration you wish to build. 5) Select "Build | Clean Solution". 6) Select "Build | Build Solution (Ctrl-Shift-B)" This project builds the libpng binaries as follows: * Win32_DLL_Release\libpng16.dll DLL build * Win32_DLL_Debug\libpng16d.dll DLL build (debug version) * Win32_DLL_VB\libpng16vb.dll DLL build for Visual Basic, using stdcall * Win32_LIB_Release\libpng.lib static build * Win32_LIB_Debug\libpngd.lib static build (debug version) Notes: If you change anything in the source files, or select different compiler settings, please change the DLL name to something different than any of the above names. Also, make sure that in your "pngusr.h" you define PNG_USER_PRIVATEBUILD and PNG_USER_DLLFNAME_POSTFIX according to the instructions provided in "pngconf.h". All DLLs built by this project use the Microsoft dynamic C runtime library MSVCR71.DLL (MSVCR71D.DLL for debug versions). If you distribute any of the above mentioned libraries you may have to include this DLL in your package. For a list of files that are redistributable in Visual Studio see $(VCINSTALLDIR)\redist.txt. ## Files: projects/vstudio/README.txt Instructions for building libpng using Microsoft Visual Studio ============================================================== Copyright (c) 2018,2022 Cosmin Truta Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This directory contains a solution for building libpng under Microsoft Visual Studio 2019. It may also work under earlier or later versions of Visual Studio. You should be familiar with Visual Studio before using this solution. Initial preparations -------------------- You must enter some information in zlib.props before attempting to build with this 'solution'. Please read and edit zlib.props first. You will probably not be familiar with the contents of zlib.props - do not worry, it is mostly harmless. This is all you need to do to build the 'release' and 'release library' configurations. Debugging --------- The release configurations default to /Ox optimization. Full debugging information is produced (in the .pdb), but if you encounter a problem the optimization may make it difficult to debug. Simply rebuild with a lower optimization level (e.g. /Od.) Linking your application ------------------------ Normally you should link against the 'release' configuration. This builds a DLL for libpng with the default runtime options used by Visual Studio. In particular the runtime library is the "MultiThreaded DLL" version. If you use Visual Studio defaults to build your application, you should have no problems. If you don't use the Visual Studio defaults your application must still be built with the default runtime option (/MD). If, for some reason, it is not then your application will crash inside libpng16.dll as soon as libpng tries to read from a file handle you pass in. If you do not want to use the DLL, and prefer static linking instead, you may choose the 'release library' configuration. This is built with a non-standard runtime library - the "MultiThreaded" version. When you build your application, it must be compiled with this option (/MT), otherwise it will not build (if you are lucky) or it will crash (if you are not.) See the WARNING file that is distributed with this README. Stop reading here ----------------- You have enough information to build a working application. Debug versions have limited support ----------------------------------- This solution includes limited support for debug versions of libpng. You do not need these unless your own solution itself uses debug builds (it is far more effective to debug on the release builds, there is no point building a special debug build unless you have heap corruption problems that you can't track down.) The debug build of libpng is minimally supported. Support for debug builds of zlib is also minimal. Please keep this in mind, if you want to use it. WARNING ------- Libpng 1.6.x does not use the default run-time library when building static library builds of libpng; instead of the shared DLL runtime, it uses a static runtime. If you need to change this, make sure to change the setting on all the relevant projects: libpng zlib all the test programs The runtime library settings for each build are as follows: Release Debug DLL /MD /MDd Library /MT /MTd Also, be sure to build libpng, zlib, and your project, all for the same platform (e.g., 32-bit or 64-bit). ## Files: scripts/cmake/README.md CMake Files, Lists and Scripts for the PNG Reference Library ============================================================ Copyright Notice ---------------- * Copyright (c) 2018-2024 Cosmin Truta. * Copyright (c) 2007-2018 Glenn Randers-Pehrson. * Originally written by Christian Ehrlicher, 2007. Use, modification and distribution of the CMake files in the libpng distribution are subject to the same licensing terms and conditions as libpng. Please see the copyright notice in `png.h` or visit http://libpng.org/pub/png/src/libpng-LICENSE.txt File List --------- CMakeLists.txt ==> The main CMake lists file scripts/cmake/AUTHORS.md ==> The Authors file scripts/cmake/README.md ==> This file scripts/cmake/PNGConfig.cmake ==> Config file for FindPNG scripts/cmake/genchk.cmake.in ==> Template for genchk.cmake scripts/cmake/genout.cmake.in ==> Template for genout.cmake scripts/cmake/gensrc.cmake.in ==> Template for gensrc.cmake scripts/cmake/test.cmake.in ==> Template for test.cmake Acknowledgements ---------------- See the accompanying file `scripts/cmake/AUTHORS.md` for the list of Contributing Authors. If you are a Contributing Author, please make sure that you are being acknowledged. ## Files: arm/arm_init.c arm_init.c - NEON optimised filter functions Copyright (c) 2018-2022 Cosmin Truta Copyright (c) 2014,2016 Glenn Randers-Pehrson Written by Mans Rullgard, 2011. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: arm/filter_neon_intrinsics.c filter_neon_intrinsics.c - NEON optimised filter functions Copyright (c) 2018 Cosmin Truta Copyright (c) 2014,2016 Glenn Randers-Pehrson Written by James Yu , October 2013. Based on filter_neon.S, written by Mans Rullgard, 2011. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: arm/palette_neon_intrinsics.c palette_neon_intrinsics.c - NEON optimised palette expansion functions Copyright (c) 2018-2019 Cosmin Truta Copyright (c) 2017-2018 Arm Holdings. All rights reserved. Written by Richard Townsend , February 2017. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: ci/ci_lint.sh ci/ci_verify_cmake.sh ci/ci_verify_configure.sh ci/ci_verify_makefiles.sh ci/ci_verify_version.sh ci/lib/ci.lib.sh ci/libexec/ci_shellify_autoconf.sh ci/libexec/ci_shellify_c.sh ci/libexec/ci_shellify_cmake.sh ci/libexec/ci_shellify_shell.sh Copyright (c) 2019-2025 Cosmin Truta. Use, modification and distribution are subject to the MIT License. Please see the accompanying file LICENSE_MIT.txt SPDX-License-Identifier: MIT ## Files: ci/targets/android/ci_env.aarch64-linux-android.sh ci/targets/android/ci_env.armv7a-linux-androideabi.sh ci/targets/android/ci_env.i686-linux-android.sh ci/targets/android/ci_env.x86_64-linux-android.sh ci/targets/cygwin/ci_env.i686-pc-cygwin.sh ci/targets/cygwin/ci_env.x86_64-pc-cygwin.sh ci/targets/darwin/ci_env.arm64-apple-darwin.sh ci/targets/darwin/ci_env.x86_64-apple-darwin.sh ci/targets/freebsd/ci_env.aarch64-unknown-freebsd.sh ci/targets/freebsd/ci_env.i686-unknown-freebsd.sh ci/targets/freebsd/ci_env.riscv64-unknown-freebsd.sh ci/targets/freebsd/ci_env.x86_64-unknown-freebsd.sh ci/targets/linux/ci_env.aarch64-linux-gnu.sh ci/targets/linux/ci_env.arm-linux-gnueabi.sh ci/targets/linux/ci_env.arm-linux-gnueabihf.sh ci/targets/linux/ci_env.i686-linux-gnu.sh ci/targets/linux/ci_env.mips-linux-gnu.sh ci/targets/linux/ci_env.mips64-linux-gnuabi64.sh ci/targets/linux/ci_env.mips64el-linux-gnuabi64.sh ci/targets/linux/ci_env.mipsel-linux-gnu.sh ci/targets/linux/ci_env.mipsisa32r6-linux-gnu.sh ci/targets/linux/ci_env.mipsisa32r6el-linux-gnu.sh ci/targets/linux/ci_env.mipsisa64r6-linux-gnuabi64.sh ci/targets/linux/ci_env.mipsisa64r6el-linux-gnuabi64.sh ci/targets/linux/ci_env.powerpc-linux-gnu.sh ci/targets/linux/ci_env.powerpc64-linux-gnu.sh ci/targets/linux/ci_env.powerpc64le-linux-gnu.sh ci/targets/linux/ci_env.riscv64-linux-gnu.sh ci/targets/linux/ci_env.x86_64-linux-gnu.sh ci/targets/msdos/ci_env.i386-pc-msdoswatcom.sh ci/targets/msdos/ci_env.i586-pc-msdosdjgpp.sh ci/targets/msdos/ci_env.i86-pc-msdoswatcom.sh ci/targets/windows/ci_env.aarch64-windows-llvm.sh ci/targets/windows/ci_env.i686-w64-mingw32.sh ci/targets/windows/ci_env.i686-windows-llvm.sh ci/targets/windows/ci_env.x86_64-w64-mingw32.sh ci/targets/windows/ci_env.x86_64-windows-llvm.sh Copyright (c) 2023-2024 Cosmin Truta. Use, modification and distribution are subject to the MIT License. Please see the accompanying file LICENSE_MIT.txt SPDX-License-Identifier: MIT ## Files: contrib/arm-neon/android-ndk.c contrib/arm-neon/android-ndk.c Copyright (c) 2014 Glenn Randers-Pehrson Written by John Bowler, 2014. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h SEE contrib/arm-neon/README before reporting bugs STATUS: COMPILED, UNTESTED BUG REPORTS: png-mng-implement@sourceforge.net png_have_neon implemented for the Android NDK, see: Documentation: http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html https://code.google.com/p/android/issues/detail?id=49065 NOTE: this requires that libpng is built against the Android NDK and linked with an implementation of the Android ARM 'cpu-features' library. The code has been compiled only, not linked: no version of the library has been found, only the header files exist in the NDK. ## Files: contrib/arm-neon/linux-auxv.c contrib/arm-neon/linux-auxv.c Copyright (c) 2014 Glenn Randers-Pehrson Written by Mans Rullgard, 2011. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h SEE contrib/arm-neon/README before reporting bugs STATUS: COMPILED, TESTED BUG REPORTS: png-mng-implement@sourceforge.net png_have_neon implemented for Linux versions which allow access to /proc/self/auxv. This is probably faster, cleaner and safer than the code to read /proc/cpuinfo in contrib/arm-neon/linux, however it is yet another piece of potentially untested code and has more complex dependencies than the code to read cpuinfo. This generic __linux__ implementation requires reading /proc/self/auxv and looking at each element for one that records NEON capabilities. ## Files: contrib/arm-neon/linux.c contrib/arm-neon/linux.c Copyright (c) 2014, 2017 Glenn Randers-Pehrson Written by John Bowler, 2014, 2017. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h SEE contrib/arm-neon/README before reporting bugs STATUS: SUPPORTED BUG REPORTS: png-mng-implement@sourceforge.net png_have_neon implemented for Linux by reading the widely available pseudo-file /proc/cpuinfo. This code is strict ANSI-C and is probably moderately portable; it does however use and it assumes that /proc/cpuinfo is never localized. ## Files: contrib/examples/iccfrompng.c - iccfrompng COPYRIGHT: Written by John Cunningham Bowler, 2011. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. This work is published from: United States. Extract any icc profiles found in the given PNG files. This is a simple example of a program that extracts information from the header of a PNG file without processing the image. Notice that some header information may occur after the image data. Textual data and comments are an example; the approach in this file won't work reliably for such data because it only looks for the information in the section of the file that precedes the image data. Compile and link against libpng and zlib, plus anything else required on the system you use. To use supply a list of PNG files containing iCCP chunks, the chunks will be extracted to a similarly named file with the extension replaced by 'icc', which will be overwritten without warning. ## Files: contrib/examples/pngpixel.c - pngpixel COPYRIGHT: Written by John Cunningham Bowler, 2011. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. This work is published from: United States. Read a single pixel value from a PNG file. This code illustrates basic 'by-row' reading of a PNG file using libpng. Rows are read until a particular pixel is found; the value of this pixel is then printed on stdout. The code illustrates how to do this on interlaced as well as non-interlaced images. Normally you would call png_set_interlace_handling() to have libpng deal with the interlace for you, but that obliges you to buffer half of the image to assemble the interlaced rows. In this code png_set_interlace_handling() is not called and, instead, the code handles the interlace passes directly looking for the required pixel. ## Files: contrib/examples/pngtopng.c - pngtopng COPYRIGHT: Written by John Cunningham Bowler, 2011, 2017. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. This work is published from: United States. Read a PNG and write it out in a fixed format, using the 'simplified API' that was introduced in libpng-1.6.0. This sample code is just the code from 'example.c' with some error handling added. See example.c in the top-level libpng directory for more comments. ## Files: contrib/examples/simpleover.c - simpleover COPYRIGHT: Written by John Cunningham Bowler, 2015. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. This work is published from: United States. Read several PNG files, which should have an alpha channel or transparency information, and composite them together to produce one or more 16-bit linear RGBA intermediates. This involves doing the 'over' compositing operation to combine the alpha channels and corresponding data. Finally read an output (background) PNG using the 24-bit RGB format (the PNG will be composited on green (#00ff00) by default if it has an alpha channel), and apply the intermediate image generated above to specified locations in the image. The command line has the general format: simpleover [output.png] {--sprite=width,height,name {[--at=x,y] {sprite.png}}} {--add=name {x,y}} The --sprite and --add options may occur multiple times. They are executed in order. --add may refer to any sprite already read. This code is intended to show how to composite multiple images together correctly. Apart from the libpng Simplified API the only work done in here is to combine multiple input PNG images into a single sprite; this involves a Porter-Duff 'over' operation and the input PNG images may, as a result, be regarded as being layered one on top of the other with the first (leftmost on the command line) being at the bottom and the last on the top. ## Files: contrib/gregbook/readpng.c rpng - simple PNG display program readpng.c --------------------------------------------------------------------------- Copyright (c) 1998-2007,2017 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/readpng.h rpng - simple PNG display program readpng.h --------------------------------------------------------------------------- Copyright (c) 1998-2007 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/readpng2.c rpng2 - progressive-model PNG display program readpng2.c --------------------------------------------------------------------------- Copyright (c) 1998-2015 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------- Changelog: 2015-11-12 - Check return value of png_get_bKGD() (Glenn R-P) 2017-04-22 - Guard against integer overflow (Glenn R-P) ## Files: contrib/gregbook/readpng2.h rpng2 - progressive-model PNG display program readpng2.h --------------------------------------------------------------------------- Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/readppm.c rpng - simple PNG display program readppm.c --------------------------------------------------------------------------- This is a special-purpose replacement for readpng.c that allows binary PPM files to be used in place of PNG images. --------------------------------------------------------------------------- Copyright (c) 1998-2007,2017 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/rpng-win.c rpng - simple PNG display program rpng-win.c This program decodes and displays PNG images, with gamma correction and optionally with a user-specified background color (in case the image has transparency). It is very nearly the most basic PNG viewer possible. This version is for 32-bit Windows; it may compile under 16-bit Windows with a little tweaking (or maybe not). to do: - handle quoted command-line args (especially filenames with spaces) - have minimum window width: oh well - use %.1023s to simplify truncation of title-bar string? --------------------------------------------------------------------------- Changelog: - 1.00: initial public release - 1.01: modified to allow abbreviated options; fixed long/ulong mis- match; switched to png_jmpbuf() macro - 1.02: added extra set of parentheses to png_jmpbuf() macro; fixed command-line parsing bug - 1.10: enabled "message window"/console (thanks to David Geldreich) - 2.00: dual-licensed (added GNU GPL) - 2.01: fixed improper display of usage screen on PNG error(s) - 2.02: check for integer overflow (Glenn R-P) --------------------------------------------------------------------------- Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/rpng-x.c rpng - simple PNG display program rpng-x.c This program decodes and displays PNG images, with gamma correction and optionally with a user-specified background color (in case the image has transparency). It is very nearly the most basic PNG viewer possible. This version is for the X Window System (tested by author under Unix and by Martin Zinser under OpenVMS; may work under OS/2 with some tweaking). to do: - 8-bit (colormapped) X support - use %.1023s to simplify truncation of title-bar string? --------------------------------------------------------------------------- Changelog: - 1.01: initial public release - 1.02: modified to allow abbreviated options; fixed long/ulong mis- match; switched to png_jmpbuf() macro - 1.10: added support for non-default visuals; fixed X pixel-conversion - 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed command-line parsing bug - 1.12: fixed some small X memory leaks (thanks to François Petitjean) - 1.13: fixed XFreeGC() crash bug (thanks to Patrick Welche) - 1.14: added support for X resources (thanks to Gerhard Niklasch) - 2.00: dual-licensed (added GNU GPL) - 2.01: fixed improper display of usage screen on PNG error(s) - 2.02: Added "void(argc);" statement to quiet pedantic compiler warnings about unused variable (GR-P) - 2.03: check for integer overflow (Glenn R-P) --------------------------------------------------------------------------- Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/rpng2-win.c rpng2 - progressive-model PNG display program rpng2-win.c This program decodes and displays PNG files progressively, as if it were a web browser (though the front end is only set up to read from files). It supports gamma correction, user-specified background colors, and user- specified background patterns (for transparent images). This version is for 32-bit Windows; it may compile under 16-bit Windows with a little tweaking (or maybe not). Thanks to Adam Costello and Pieter S. van der Meulen for the "diamond" and "radial waves" patterns, respectively. to do (someday, maybe): - handle quoted command-line args (especially filenames with spaces) - finish resizable checkerboard-gradient (sizes 4-128?) - use %.1023s to simplify truncation of title-bar string? - have minimum window width: oh well --------------------------------------------------------------------------- Changelog: - 1.01: initial public release - 1.02: fixed cut-and-paste error in usage screen (oops...) - 1.03: modified to allow abbreviated options - 1.04: removed bogus extra argument from usage fprintf() [Glenn R-P?]; fixed command-line parsing bug - 1.10: enabled "message window"/console (thanks to David Geldreich) - 1.20: added runtime MMX-enabling/disabling and new -mmx* options - 1.21: made minor tweak to usage screen to fit within 25-line console - 1.22: added AMD64/EM64T support (__x86_64__) - 2.00: dual-licensed (added GNU GPL) - 2.01: fixed 64-bit typo in readpng2.c - 2.02: fixed improper display of usage screen on PNG error(s); fixed unexpected-EOF and file-read-error cases - 2.03: removed runtime MMX-enabling/disabling and obsolete -mmx* options - 2.04: check for integer overflow (Glenn R-P) --------------------------------------------------------------------------- Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/rpng2-x.c rpng2 - progressive-model PNG display program rpng2-x.c This program decodes and displays PNG files progressively, as if it were a web browser (though the front end is only set up to read from files). It supports gamma correction, user-specified background colors, and user- specified background patterns (for transparent images). This version is for the X Window System (tested by the author under Unix and by Martin Zinser under OpenVMS; may work under OS/2 with a little tweaking). Thanks to Adam Costello and Pieter S. van der Meulen for the "diamond" and "radial waves" patterns, respectively. to do (someday, maybe): - fix expose/redraw code: don't draw entire row if only part exposed - 8-bit (colormapped) X support - finish resizable checkerboard-gradient (sizes 4-128?) - use %.1023s to simplify truncation of title-bar string? --------------------------------------------------------------------------- Changelog: - 1.01: initial public release - 1.02: modified to allow abbreviated options; fixed char/uchar mismatch - 1.10: added support for non-default visuals; fixed X pixel-conversion - 1.11: added -usleep option for demos; fixed command-line parsing bug - 1.12: added -pause option for demos and testing - 1.20: added runtime MMX-enabling/disabling and new -mmx* options - 1.21: fixed some small X memory leaks (thanks to François Petitjean) - 1.22: fixed XFreeGC() crash bug (thanks to Patrick Welche) - 1.23: added -bgpat 0 mode (std white/gray checkerboard, 8x8 squares) - 1.30: added -loop option for -bgpat (ifdef FEATURE_LOOP); fixed bpp = 24; added support for X resources (thanks to Gerhard Niklasch) - 1.31: added code to skip unused chunks (thanks to Glenn Randers-Pehrson) - 1.32: added AMD64/EM64T support (__x86_64__); added basic expose/redraw handling - 2.00: dual-licensed (added GNU GPL) - 2.01: fixed 64-bit typo in readpng2.c; fixed -pause usage description - 2.02: fixed improper display of usage screen on PNG error(s); fixed unexpected-EOF and file-read-error cases; fixed Trace() cut-and- paste bugs - 2.03: deleted runtime MMX-enabling/disabling and obsolete -mmx* options - 2.04: Added "void(foo);" statements to quiet pedantic compiler warnings about unused variables (GR-P) - 2.05: Use nanosleep() instead of usleep(), which is deprecated (GR-P). - 2.06: check for integer overflow (Glenn R-P) --------------------------------------------------------------------------- Copyright (c) 1998-2010, 2014-2015, 2017 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/wpng.c wpng - simple PNG-writing program wpng.c This program converts certain NetPBM binary files (grayscale and RGB, maxval = 255) to PNG. Non-interlaced PNGs are written progressively; interlaced PNGs are read and written in one memory-intensive blast. Thanks to Jean-loup Gailly for providing the necessary trick to read interactive text from the keyboard while stdin is redirected. Thanks to Cosmin Truta for Cygwin fixes. NOTE: includes provisional support for PNM type "8" (portable alphamap) images, presumed to be a 32-bit interleaved RGBA format; no pro- vision for possible interleaved grayscale+alpha (16-bit) format. THIS IS UNLIKELY TO BECOME AN OFFICIAL NETPBM ALPHA FORMAT! to do: - delete output file if quit before calling any writepng routines - process backspace with -text option under DOS/Win? (currently get ^H) --------------------------------------------------------------------------- Changelog: - 1.01: initial public release - 1.02: modified to allow abbreviated options - 1.03: removed extraneous character from usage screen; fixed bug in command-line parsing - 1.04: fixed DOS/OS2/Win32 detection, including partial Cygwin fix (see http://home.att.net/~perlspinr/diffs/GregBook_cygwin.diff) - 2.00: dual-licensed (added GNU GPL) - 2.01: check for integer overflow (Glenn R-P) [REPORTED BUG (win32 only): "contrib/gregbook/wpng.c - cmd line dose not work! In order to do something useful I needed to redirect both input and output, with cygwin and with bcc32 as well. Under Linux, the same wpng appears to work fine. I don't know what is the problem."] --------------------------------------------------------------------------- Copyright (c) 1998-2007, 2017 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/writepng.c wpng - simple PNG-writing program writepng.c --------------------------------------------------------------------------- Copyright (c) 1998-2007, 2017 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/gregbook/writepng.h wpng - simple PNG-writing program writepng.h --------------------------------------------------------------------------- Copyright (c) 1998-2007 Greg Roelofs. All rights reserved. This software is provided "as is," without warranty of any kind, express or implied. In no event shall the author or contributors be held liable for any damages arising in any way from the use of this software. The contents of this file are DUAL-LICENSED. You may modify and/or redistribute this software according to the terms of one of the following two licenses (at your option): LICENSE 1 ("BSD-like with advertising clause"): Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. Redistributions of source code must retain the above copyright notice, disclaimer, and this list of conditions. 2. Redistributions in binary form must reproduce the above copyright notice, disclaimer, and this list of conditions in the documenta- tion and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Greg Roelofs and contributors for the book, "PNG: The Definitive Guide," published by O'Reilly and Associates. LICENSE 2 (GNU GPL v2 or later): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Files: contrib/libtests/fakepng.c Fake a PNG - just write it out directly. COPYRIGHT: Written by John Cunningham Bowler, 2014. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. This work is published from: United States. ## Files: contrib/libtests/gentests.sh Copyright (c) 2013 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Generate a set of PNG test images. The images are generated in a sub-directory called 'tests' by default, however a command line argument will change that name. The generation requires a built version of makepng in the current directory. ## Files: contrib/libtests/makepng.c Copyright: ## Files: contrib/libtests/makepng.c This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Make a test PNG image. The arguments are as follows: makepng [--sRGB|--linear|--1.8] [--tRNS] [--nofilters] \ color-type bit-depth [file-name] The color-type may be numeric (and must match the numbers used by the PNG specification) or one of the format names listed below. The bit-depth is the component bit depth, or the pixel bit-depth for a color-mapped image. Without any options no color-space information is written, with the options an sRGB or the appropriate gAMA chunk is written. "1.8" refers to the display system used on older Apple computers to correct for high ambient light levels in the viewing environment; it applies a transform of approximately value^(1/1.45) to the color values and so a gAMA chunk of 65909 is written (1.45/2.2). The image data is generated internally. Unless --color is given the images used are as follows: 1 channel: a square image with a diamond, the least luminous colors are on the edge of the image, the most luminous in the center. 2 channels: the color channel increases in luminosity from top to bottom, the alpha channel increases in opacity from left to right. 3 channels: linear combinations of, from the top-left corner clockwise, black, green, white, red. 4 channels: linear combinations of, from the top-left corner clockwise, transparent, red, green, blue. For color-mapped images a four channel color-map is used and if --tRNS is given the PNG file has a tRNS chunk, as follows: 1-bit: entry 0 is transparent-red, entry 1 is opaque-white 2-bit: entry 0: transparent-green entry 1: 40%-red entry 2: 80%-blue entry 3: opaque-white 4-bit: the 16 combinations of the 2-bit case 8-bit: the 256 combinations of the 4-bit case The palette always has 2^bit-depth entries and the tRNS chunk one fewer. The image is the 1-channel diamond, but using palette index, not luminosity. For formats other than color-mapped ones if --tRNS is specified a tRNS chunk is generated with all channels equal to the low bits of 0x0101. Image size is determined by the final pixel depth in bits, i.e. channels x bit-depth, as follows: 8 bits or less: 64x64 16 bits: 256x256 More than 16 bits: 1024x1024 Row filtering is the libpng default but may be turned off (the 'none' filter is used on every row) with the --nofilters option. The images are not interlaced. If file-name is given then the PNG is written to that file, else it is written to stdout. Notice that stdout is not supported on systems where, by default, it assumes text output; this program makes no attempt to change the text mode of stdout! makepng --color= ... If --color is given then the whole image has that color, color-mapped images will have exactly one palette entry and all image files with be 16x16 in size. The color value is 1 to 4 decimal numbers as appropriate for the color type. makepng --small ... If --small is given the images are no larger than required to include every possible pixel value for the format. For formats with pixels 8 bits or fewer in size the images consist of a single row with 2^pixel-depth pixels, one of every possible value. For formats with 16-bit pixels a 256x256 image is generated containing every possible pixel value. For larger pixel sizes a 256x256 image is generated where the first row consists of each pixel that has identical byte values throughout the pixel followed by rows where the byte values differ within the pixel. In all cases the pixel values are arranged in such a way that the SUB and UP filters give byte sequences for maximal zlib compression. By default (if --nofilters is not given) the SUB filter is used on the first row and the UP filter on all following rows. The --small option is meant to provide good test-case coverage, however the images are not easy to examine visually. Without the --small option the images contain identical color values; the pixel values are adjusted according to the gamma encoding with no gamma encoding being interpreted as sRGB. LICENSING ========= This code is copyright of the authors, see the COPYRIGHT define above. The code is licensed as above, using the libpng license. The code generates images which are solely the product of the code; the options choose which of the many possibilities to generate. The images that result (but not the code which generates them) are licensed as defined here: IMPORTANT: the COPYRIGHT #define must contain ISO-Latin-1 characters, the IMAGE_LICENSING #define must contain UTF-8 characters. The 'copyright' symbol 0xA9U (\251) in ISO-Latin-1 encoding and 0xC20xA9 (\302\251) in UTF-8. ## Files: contrib/libtests/makepng.c Max out the text compression level in an attempt to make the license small. If --small then do the same for the IDAT. ## Files: contrib/libtests/makepng.c These are used to insert Copyright and Licence fields, they allow the text to have \n unlike the --insert option. ## Files: contrib/libtests/makepng.c Insert standard copyright and licence text. ## Files: contrib/libtests/pngimage.c pngimage.c Copyright (c) 2021 Cosmin Truta Copyright (c) 2015,2016 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Test the png_read_png and png_write_png interfaces. Given a PNG file load it using png_read_png and then write with png_write_png. Test all possible transforms. ## Files: contrib/libtests/pngstest-errors.h contrib/libtests/pngstest-errors.h BUILT USING: libpng version 1.6.19beta03 - September 25, 2015 This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h THIS IS A MACHINE GENERATED FILE: do not edit it directly! Instead run: pngstest --accumulate on as many PNG files as possible; at least PNGSuite and contrib/libtests/testpngs. ## Files: contrib/libtests/pngstest.c pngstest.c Copyright (c) 2021 Cosmin Truta Copyright (c) 2013-2017 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Test for the PNG 'simplified' APIs. ## Files: contrib/libtests/pngunknown.c pngunknown.c - test the read side unknown chunk handling Copyright (c) 2021 Cosmin Truta Copyright (c) 2015,2017 Glenn Randers-Pehrson Written by John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h NOTES: This is a C program that is intended to be linked against libpng. It allows the libpng unknown handling code to be tested by interpreting arguments to save or discard combinations of chunks. The program is currently just a minimal validation for the built-in libpng facilities. ## Files: contrib/libtests/pngvalid.c pngvalid.c - validate libpng by constructing then reading png files. Copyright (c) 2021 Cosmin Truta Copyright (c) 2014-2017 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h NOTES: This is a C program that is intended to be linked against libpng. It generates bitmaps internally, stores them as PNG files (using the sequential write code) then reads them back (using the sequential read code) and validates that the result has the correct data. The program can be modified and extended to test the correctness of transformations performed by libpng. ## Files: contrib/libtests/readpng.c readpng.c Copyright (c) 2013 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Load an arbitrary number of PNG files (from the command line, or, if there are no arguments on the command line, from stdin) then run a time test by reading each file by row. The test does nothing with the read result and does no transforms. The only output is a time as a floating point number of seconds with 9 decimal digits. ## Files: contrib/libtests/tarith.c tarith.c Copyright (c) 2021 Cosmin Truta Copyright (c) 2011-2013 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Test internal arithmetic functions of libpng. This code must be linked against a math library (-lm), but does not require libpng or zlib to work. Because it includes the complete source of 'png.c' it tests the code with whatever compiler options are used to build it. Changing these options can substantially change the errors in the calculations that the compiler chooses! ## Files: contrib/libtests/timepng.c timepng.c Copyright (c) 2013,2016 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Load an arbitrary number of PNG files (from the command line, or, if there are no arguments on the command line, from stdin) then run a time test by reading each file by row or by image (possibly with transforms in the latter case). The only output is a time as a floating point number of seconds with 9 decimal digits. ## Files: contrib/mips-mmi/linux.c contrib/mips-mmi/linux.c Copyright (c) 2024 Cosmin Truta Written by guxiwei, 2023 This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: contrib/mips-msa/linux.c contrib/mips-msa/linux.c Copyright (c) 2020-2023 Cosmin Truta Copyright (c) 2016 Glenn Randers-Pehrson Written by Mandar Sahastrabuddhe, 2016. Updated by Sui Jingfeng, 2021. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h On Linux, png_have_msa is implemented by reading the pseudo-file "/proc/self/auxv". See contrib/mips-msa/README before reporting bugs. STATUS: SUPPORTED BUG REPORTS: png-mng-implement@sourceforge.net ## Files: contrib/oss-fuzz/build.sh Copyright 2017-2018 Glenn Randers-Pehrson Copyright 2016 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Revisions by Glenn Randers-Pehrson, 2017: 1. Build only the library, not the tools (changed "make -j$(nproc) all" to "make -j$(nproc) libpng16.la"). 2. Disabled WARNING and WRITE options in pnglibconf.dfa. 3. Build zlib alongside libpng ############################################################################### ## Files: contrib/oss-fuzz/libpng_read_fuzzer.cc libpng_read_fuzzer.cc Copyright 2017-2018 Glenn Randers-Pehrson Copyright 2015 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that may be found in the LICENSE file https://cs.chromium.org/chromium/src/LICENSE ## Files: contrib/pngexif/bytepack.py Byte packing and unpacking utilities. Copyright (C) 2017-2020 Cosmin Truta. Use, modification and distribution are subject to the MIT License. Please see the accompanying file LICENSE_MIT.txt ## Files: contrib/pngexif/exifinfo.py Show the EXIF information. Copyright (C) 2017-2020 Cosmin Truta. Use, modification and distribution are subject to the MIT License. Please see the accompanying file LICENSE_MIT.txt ## Files: contrib/pngexif/pngexifinfo.py Show the PNG EXIF information. Copyright (C) 2017-2020 Cosmin Truta. Use, modification and distribution are subject to the MIT License. Please see the accompanying file LICENSE_MIT.txt ## Files: contrib/pngminim/decoder/pngusr.h minrdpngconf.h: headers to make a minimal png-read-only library Copyright (c) 2007, 2010-2013 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson ## Files: contrib/pngminim/encoder/pngusr.h minwrpngconf.h: headers to make a minimal png-write-only library Copyright (c) 2007, 2010-2013 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson ## Files: contrib/pngminim/preader/pngusr.h minrdpngconf.h: headers to make a minimal png-read-only library Copyright (c) 2009, 2010-2013 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson ## Files: contrib/pngminus/png2pnm.c png2pnm.c --- conversion from PNG-file to PGM/PPM-file copyright (C) 1999-2019 by Willem van Schaik This software is released under the MIT license. For conditions of distribution and use, see the LICENSE file part of this package. ## Files: contrib/pngminus/pnm2png.c pnm2png.c --- conversion from PBM/PGM/PPM-file to PNG-file copyright (C) 1999-2019 by Willem van Schaik This software is released under the MIT license. For conditions of distribution and use, see the LICENSE file part of this package. ## Files: contrib/powerpc-vsx/linux.c contrib/powerpc-vsx/linux.c Copyright (c) 2017 Glenn Randers-Pehrson Written by Vadim Barkov, 2017. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h STATUS: TESTED BUG REPORTS: png-mng-implement@sourceforge.net png_have_vsx implemented for Linux by reading the widely available pseudo-file /proc/cpuinfo. This code is strict ANSI-C and is probably moderately portable; it does however use and it assumes that /proc/cpuinfo is never localized. ## Files: contrib/powerpc-vsx/linux_aux.c contrib/powerpc-vsx/linux_aux.c Copyright (c) 2017 Glenn Randers-Pehrson Written by Vadim Barkov, 2017. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h STATUS: TESTED BUG REPORTS: png-mng-implement@sourceforge.net png_have_vsx implemented for Linux by using the auxiliary vector mechanism. This code is strict ANSI-C and is probably moderately portable; it does however use and it assumes that /proc/cpuinfo is never localized. ## Files: contrib/riscv-rvv/linux.c contrib/riscv-rvv/linux.c Copyright (c) 2023 Google LLC Written by Dragoș Tiselice , May 2023. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h SEE contrib/riscv-rvv/README before reporting bugs STATUS: SUPPORTED BUG REPORTS: png-mng-implement@sourceforge.net png_have_rvv implemented for Linux by looking for COMPAT_HWCAP_ISA_V via hardware capabilites API. This code is strict ANSI-C and is probably moderately portable; it does however use and it assumes that /proc/cpuinfo is never localized. ## Files: contrib/testpngs/makepngs.sh Copyright (c) 2015 John Cunningham Bowler ## Files: contrib/testpngs/makepngs.sh This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: contrib/tools/checksum-icc.c checksum-icc.c Copyright (c) 2013 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Generate crc32 and adler32 checksums of the given input files, used to generate check-codes for use when matching ICC profiles within libpng. ## Files: contrib/tools/cvtcolor.c convert.c COPYRIGHT: Written by John Cunningham Bowler, 2013. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. This work is published from: United States. Convert 8-bit sRGB or 16-bit linear values to another format. ## Files: contrib/tools/genpng.c genpng COPYRIGHT: Written by John Cunningham Bowler, 2015. Revised by Glenn Randers-Pehrson, 2017, to add buffer-size check. To the extent possible under law, the authors have waived all copyright and related or neighboring rights to this work. This work is published from: United States. Generate a PNG with an alpha channel, correctly. This is a test case generator; the resultant PNG files are only of interest to those of us who care about whether the edges of circles are green, red, or yellow. The program generates an RGB+Alpha PNG of a given size containing the given shapes on a transparent background: genpng width height { shape } shape ::= color width shape x1 y1 x2 y2 'color' is: black white red green yellow blue brown purple pink orange gray cyan The point is to have colors that are linguistically meaningful plus that old bugbear of the department store dress murders, Cyan, the only color we argue about. 'shape' is: circle: an ellipse square: a rectangle line: a straight line Each shape is followed by four numbers, these are two points in the output coordinate space (as real numbers) which describe the circle, square, or line. The shape is filled if it is preceded by 'filled' (not valid for 'line') or is drawn with a line, in which case the width of the line must precede the shape. The whole set of information can be repeated as many times as desired: shape ::= color width shape x1 y1 x2 y2 color ::= black|white|red|green|yellow|blue color ::= brown|purple|pink|orange|gray|cyan width ::= filled width ::= shape ::= circle|square|line x1 ::= x2 ::= y1 ::= y2 ::= The output PNG is generated by down-sampling a 4x supersampled image using a bi-cubic filter. The bi-cubic has a 2 (output) pixel width, so an 8x8 array of super-sampled points contribute to each output pixel. The value of a super-sampled point is found using an unfiltered, aliased, infinite precision image: Each shape from the last to the first is checked to see if the point is in the drawn area and, if it is, the color of the point is the color of the shape and the alpha is 1, if not the previous shape is checked. This is an aliased algorithm because no filtering is done; a point is either inside or outside each shape and 'close' points do not contribute to the sample. The down-sampling is relied on to correct the error of not using a filter. The line end-caps are 'flat'; they go through the points. The square line joins are mitres; the outside of the lines are continued to the point of intersection. ## Files: contrib/tools/intgamma.sh intgamma.sh COPYRIGHT: Written by John Cunningham Bowler, 2013. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. The author published this work from the United States. Shell script to generate png.c 8-bit and 16-bit log tables (see the code in png.c for details). This script uses the "bc" arbitrary precision calculator to calculate 32-bit fixed point values of logarithms appropriate to finding the log of an 8-bit (0..255) value and a similar table for the exponent calculation. "bc" must be on the path when the script is executed, and the math library (-lm) must be available. ## Files: contrib/tools/makesRGB.c makesRGB.c -- build sRGB-to-linear and linear-to-sRGB conversion tables COPYRIGHT: Written by John Cunningham Bowler, 2013. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. This work is published from: United States. Make a table to convert 8-bit sRGB encoding values into the closest 16-bit linear value. Make two tables to take a linear value scaled to 255*65535 and return an approximation to the 8-bit sRGB encoded value. Calculate the error in these tables and display it. ## Files: contrib/tools/png-fix-itxt.c png-fix-itxt Copyright 2015 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Usage: png-fix-itxt < bad.png > good.png Fixes a PNG file written with libpng-1.6.0 or 1.6.1 that has one or more uncompressed iTXt chunks. Assumes that the actual length is greater than or equal to the value in the length byte, and that the CRC is correct for the actual length. This program hunts for the CRC and adjusts the length byte accordingly. It is not an error to process a PNG file that has no iTXt chunks or one that has valid iTXt chunks; such files will simply be copied. Requires zlib (for crc32 and Z_NULL); build with gcc -O -o png-fix-itxt png-fix-itxt.c -lz If you need to handle iTXt chunks larger than 500000 kbytes you must rebuild png-fix-itxt with a larger values of MAX_LENGTH (or a smaller value if you know you will never encounter such huge iTXt chunks). ## Files: contrib/tools/pngcp.c pngcp.c Copyright (c) 2016,2022,2024 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This is an example of copying a PNG without changes using the png_read_png and png_write_png interfaces. A considerable number of options are provided to manipulate the compression of the PNG data and other compressed chunks. For a more extensive example that uses the transforms see contrib/libtests/pngimage.c in the libpng distribution. This code is not intended for installation in a release system; the command line options are not documented and most of the behavior is intended for testing libpng performance, both speed and compression. ## Files: contrib/tools/pngfix.c pngfix.c Copyright (c) 2014-2017,2024 John Cunningham Bowler This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Tool to check and fix the zlib inflate 'too far back' problem. See the usage message for more information. ## Files: contrib/tools/sRGB.h sRGB.h COPYRIGHT: Written by John Cunningham Bowler, 2013. To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work. This work is published from: United States. Utility file; not actually a header, this contains definitions of sRGB calculation functions for inclusion in those test programs that need them. All routines take and return a floating point value in the range 0 to 1.0, doing a calculation according to the sRGB specification (in fact the source of the numbers is the wikipedia article at https://en.wikipedia.org/wiki/SRGB). ## Files: contrib/visupng/PngFile.c PNGFILE.C -- Image File Functions ------------------------------------- Copyright 2000,2017 Willem van Schaik. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: contrib/visupng/PngFile.h Copyright 2000, Willem van Schaik. ## Files: contrib/visupng/PngFile.h This code is released under the libpng license. ## Files: contrib/visupng/VisualPng.c VisualPng.C -- Shows a PNG image ------------------------------------ Copyright 2000,2017 Willem van Schaik. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: contrib/visupng/cexcept.h === cexcept.h 2.0.1 (2008-Jul-19-Sat) http://www.nicemice.net/cexcept/ Adam M. Costello http://www.nicemice.net/amc/ An interface for exception-handling in ANSI C (C89 and subsequent ISO standards), developed jointly with Cosmin Truta. Copyright (c) 2000-2008 Adam M. Costello and Cosmin Truta. This software may be modified only if its author and version information is updated accurately, and may be redistributed only if accompanied by this unaltered notice. Subject to those restrictions, permission is granted to anyone to do anything with this software. The copyright holders make no guarantees regarding this software, and are not responsible for any damage resulting from its use. The cexcept interface is not compatible with and cannot interact with system exceptions (like division by zero or memory segmentation violation), compiler-generated exceptions (like C++ exceptions), or other exception-handling interfaces. When using this interface across multiple .c files, do not include this header file directly. Instead, create a wrapper header file that includes this header file and then invokes the define_exception_type macro (see below). The .c files should then include that header file. The interface consists of one type, one well-known name, and six macros. define_exception_type(type_name); This macro is used like an external declaration. It specifies the type of object that gets copied from the exception thrower to the exception catcher. The type_name can be any type that can be assigned to, that is, a non-constant arithmetic type, struct, union, or pointer. Examples: define_exception_type(int); enum exception { out_of_memory, bad_arguments, disk_full }; define_exception_type(enum exception); struct exception { int code; const char *msg; }; define_exception_type(struct exception); Because throwing an exception causes the object to be copied (not just once, but twice), programmers may wish to consider size when choosing the exception type. struct exception_context; This type may be used after the define_exception_type() macro has been invoked. A struct exception_context must be known to both the thrower and the catcher. It is expected that there be one context for each thread that uses exceptions. It would certainly be dangerous for multiple threads to access the same context. One thread can use multiple contexts, but that is likely to be confusing and not typically useful. The application can allocate this structure in any way it pleases--automatic, static, or dynamic. The application programmer should pretend not to know the structure members, which are subject to change. struct exception_context *the_exception_context; The Try/Catch and Throw statements (described below) implicitly refer to a context, using the name the_exception_context. It is the application's responsibility to make sure that this name yields the address of a mutable (non-constant) struct exception_context wherever those statements are used. Subject to that constraint, the application may declare a variable of this name anywhere it likes (inside a function, in a parameter list, or externally), and may use whatever storage class specifiers (static, extern, etc) or type qualifiers (const, volatile, etc) it likes. Examples: static struct exception_context * const the_exception_context = &foo; { struct exception_context *the_exception_context = bar; ... } int blah(struct exception_context *the_exception_context, ...); extern struct exception_context the_exception_context[1]; The last example illustrates a trick that avoids creating a pointer object separate from the structure object. The name could even be a macro, for example: struct exception_context ec_array[numthreads]; #define the_exception_context (ec_array + thread_id) Be aware that the_exception_context is used several times by the Try/Catch/Throw macros, so it shouldn't be expensive or have side effects. The expansion must be a drop-in replacement for an identifier, so it's safest to put parentheses around it. void init_exception_context(struct exception_context *ec); For context structures allocated statically (by an external definition or using the "static" keyword), the implicit initialization to all zeros is sufficient, but contexts allocated by other means must be initialized using this macro before they are used by a Try/Catch statement. It does no harm to initialize a context more than once (by using this macro on a statically allocated context, or using this macro twice on the same context), but a context must not be re-initialized after it has been used by a Try/Catch statement. Try statement Catch (expression) statement The Try/Catch/Throw macros are capitalized in order to avoid confusion with the C++ keywords, which have subtly different semantics. A Try/Catch statement has a syntax similar to an if/else statement, except that the parenthesized expression goes after the second keyword rather than the first. As with if/else, there are two clauses, each of which may be a simple statement ending with a semicolon or a brace-enclosed compound statement. But whereas the else clause is optional, the Catch clause is required. The expression must be a modifiable lvalue (something capable of being assigned to) of the same type (disregarding type qualifiers) that was passed to define_exception_type(). If a Throw that uses the same exception context as the Try/Catch is executed within the Try clause (typically within a function called by the Try clause), and the exception is not caught by a nested Try/Catch statement, then a copy of the exception will be assigned to the expression, and control will jump to the Catch clause. If no such Throw is executed, then the assignment is not performed, and the Catch clause is not executed. The expression is not evaluated unless and until the exception is caught, which is significant if it has side effects, for example: Try foo(); Catch (p[++i].e) { ... } IMPORTANT: Jumping into or out of a Try clause (for example via return, break, continue, goto, longjmp) is forbidden--the compiler will not complain, but bad things will happen at run-time. Jumping into or out of a Catch clause is okay, and so is jumping around inside a Try clause. In many cases where one is tempted to return from a Try clause, it will suffice to use Throw, and then return from the Catch clause. Another option is to set a flag variable and use goto to jump to the end of the Try clause, then check the flag after the Try/Catch statement. IMPORTANT: The values of any non-volatile automatic variables changed within the Try clause are undefined after an exception is caught. Therefore, variables modified inside the Try block whose values are needed later outside the Try block must either use static storage or be declared with the "volatile" type qualifier. Throw expression; A Throw statement is very much like a return statement, except that the expression is required. Whereas return jumps back to the place where the current function was called, Throw jumps back to the Catch clause of the innermost enclosing Try clause. The expression must be compatible with the type passed to define_exception_type(). The exception must be caught, otherwise the program may crash. Slight limitation: If the expression is a comma-expression, it must be enclosed in parentheses. Try statement Catch_anonymous statement When the value of the exception is not needed, a Try/Catch statement can use Catch_anonymous instead of Catch (expression). Everything below this point is for the benefit of the compiler. The application programmer should pretend not to know any of it, because it is subject to change. === ## Files: example.c example.c - an example of using libpng Maintained 2018-2025 Cosmin Truta Maintained 1998-2016 Glenn Randers-Pehrson Maintained 1996-1997 Andreas Dilger Written 1995-1996 Guy Eric Schalnat, Group 42, Inc. To the extent possible under law, the authors have waived all copyright and related or neighboring rights to this file. This work is published from: United States, Canada. ## Files: example.c This is an example of how to use libpng to read and write PNG files. The file libpng-manual.txt is much more verbose then this. If you have not read it, do so first. This was designed to be a starting point of an implementation. This is not officially part of libpng, is hereby placed in the public domain, and therefore does not require a copyright notice. This file does not currently compile, because it is missing certain parts, like allocating memory to hold an image. You will have to supply these parts to get it to compile. For an example of a minimal working PNG reader/writer, see pngtest.c, included in this distribution; see also the programs in the contrib directory. ## Files: intel/filter_sse2_intrinsics.c filter_sse2_intrinsics.c - SSE2 optimized filter functions Copyright (c) 2018 Cosmin Truta Copyright (c) 2016-2017 Glenn Randers-Pehrson Written by Mike Klein and Matt Sarett Derived from arm/filter_neon_intrinsics.c This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: intel/intel_init.c intel_init.c - SSE2 optimized filter functions Copyright (c) 2018 Cosmin Truta Copyright (c) 2016-2017 Glenn Randers-Pehrson Written by Mike Klein and Matt Sarett, Google, Inc. Derived from arm/arm_init.c This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: loongarch/filter_lsx_intrinsics.c filter_lsx_intrinsics.c - LSX optimized filter functions Copyright (c) 2021 Loongson Technology Corporation Limited All rights reserved. Copyright (c) 2018 Cosmin Truta Copyright (c) 2016 Glenn Randers-Pehrson Contributed by Jin Bo (jinbo@loongson.cn) This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: loongarch/loongarch_lsx_init.c loongarch_lsx_init.c - LSX optimized filter functions Copyright (c) 2021 Loongson Technology Corporation Limited All rights reserved. Contributed by Jin Bo This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: ltmain.sh Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## Files: ltmain.sh GNU Libtool is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libtool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ## Files: ltmain.sh This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors This file is dual licensed under the terms of the MIT license , and GPL version 2 or later . You must apply one of these licenses when using or redistributing this software or any of the files within it. See the URLs above, or the file `LICENSE` included in the Bootstrap distribution for the full license texts. ## Files: ltmain.sh This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors This file is dual licensed under the terms of the MIT license , and GPL version 2 or later . You must apply one of these licenses when using or redistributing this software or any of the files within it. See the URLs above, or the file `LICENSE` included in the Bootstrap distribution for the full license texts. ## Files: ltmain.sh This file is a library for parsing options in your shell scripts along with assorted other useful supporting features that you can make use of too. For the simplest scripts you might need only: #!/bin/sh . relative/path/to/funclib.sh . relative/path/to/options-parser scriptversion=1.0 func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ...rest of your script... In order for the '--version' option to work, you will need to have a suitably formatted comment like the one at the top of this file starting with '# Written by ' and ending with '# Copyright'. For '-h' and '--help' to work, you will also need a one line description of your script's purpose in a comment directly above the '# Written by ' line, like the one at the top of this file. The default options also support '--debug', which will turn on shell execution tracing (see the comment above debug_cmd below for another use), and '--verbose' and the func_verbose function to allow your script to display verbose messages only when your user has specified '--verbose'. After sourcing this file, you can plug in processing for additional options by amending the variables from the 'Configuration' section below, and following the instructions in the 'Option parsing' section further down. ## Files: ltmain.sh func_version ------------ Echo version message to standard output and exit. The version message is extracted from the calling file's header comments, with leading '# ' stripped: 1. First display the progname and version 2. Followed by the header comment line matching /^# Written by / 3. Then a blank line followed by the first following line matching /^# Copyright / 4. Immediately followed by any lines between the previous matches, except lines preceding the intervening completely blank line. For example, see the header comments of this file. ## Files: mips/filter_mmi_inline_assembly.c filter_mmi_intrinsics.c - MMI optimized filter functions Copyright (c) 2024 Cosmin Truta Written by zhanglixia and guxiwei, 2023 This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: mips/filter_msa_intrinsics.c filter_msa_intrinsics.c - MSA optimised filter functions Copyright (c) 2018-2024 Cosmin Truta Copyright (c) 2016 Glenn Randers-Pehrson Written by Mandar Sahastrabuddhe, August 2016 This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: mips/mips_init.c mips_init.c - MSA optimised filter functions Copyright (c) 2018-2024 Cosmin Truta Copyright (c) 2016 Glenn Randers-Pehrson Written by Mandar Sahastrabuddhe, 2016 Updated by guxiwei, 2023 This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: png.c png.c - location for general purpose libpng functions Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: png.h png.h - header file for PNG reference library libpng version 1.6.50 Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. (See LICENSE, below.) Authors and maintainers: libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger libpng versions 0.97, January 1998, through 1.6.35, July 2018: Glenn Randers-Pehrson libpng versions 1.6.36, December 2018, through 1.6.50, July 2025: Cosmin Truta See also "Contributing Authors", below. ## Files: png.h COPYRIGHT NOTICE, DISCLAIMER, and LICENSE ========================================= PNG Reference Library License version 2 --------------------------------------- * Copyright (c) 1995-2025 The PNG Reference Library Authors. * Copyright (c) 2018-2025 Cosmin Truta. * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. * Copyright (c) 1996-1997 Andreas Dilger. * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. The software is supplied "as is", without warranty of any kind, express or implied, including, without limitation, the warranties of merchantability, fitness for a particular purpose, title, and non-infringement. In no event shall the Copyright owners, or anyone distributing the software, be liable for any damages or other liability, whether in contract, tort or otherwise, arising from, out of, or in connection with the software, or the use or other dealings in the software, even if advised of the possibility of such damage. Permission is hereby granted to use, copy, modify, and distribute this software, or portions hereof, for any purpose, without fee, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated, but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This Copyright notice may not be removed or altered from any source or altered source distribution. PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) ----------------------------------------------------------------------- libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are derived from libpng-1.0.6, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors: Simon-Pierre Cadieux Eric S. Raymond Mans Rullgard Cosmin Truta Gilles Vollant James Yu Mandar Sahastrabuddhe Google Inc. Vadim Barkov and with the following additions to the disclaimer: There is no warranty against interference with your enjoyment of the library or against infringement. There is no warranty that our efforts or the library will fulfill any of your particular purposes or needs. This library is provided with all faults, and the entire risk of satisfactory quality, performance, accuracy, and effort is with the user. Some files in the "contrib" directory and some configure-generated files that are distributed with libpng have other copyright owners, and are released under other open source licenses. libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from libpng-0.96, and are distributed according to the same disclaimer and license as libpng-0.96, with the following individuals added to the list of Contributing Authors: Tom Lane Glenn Randers-Pehrson Willem van Schaik libpng versions 0.89, June 1996, through 0.96, May 1997, are Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, and are distributed according to the same disclaimer and license as libpng-0.88, with the following individuals added to the list of Contributing Authors: John Bowler Kevin Bracey Sam Bushell Magnus Holmgren Greg Roelofs Tom Tanner Some files in the "scripts" directory have other copyright owners, but are released under this license. libpng versions 0.5, May 1995, through 0.88, January 1996, are Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. For the purposes of this copyright and license, "Contributing Authors" is defined as the following set of individuals: Andreas Dilger Dave Martindale Guy Eric Schalnat Paul Schmidt Tim Wegner The PNG Reference Library is supplied "AS IS". The Contributing Authors and Group 42, Inc. disclaim all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The Contributing Authors and Group 42, Inc. assume no liability for direct, indirect, incidental, special, exemplary, or consequential damages, which may result from the use of the PNG Reference Library, even if advised of the possibility of such damage. Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, for any purpose, without fee, subject to the following restrictions: 1. The origin of this source code must not be misrepresented. 2. Altered versions must be plainly marked as such and must not be misrepresented as being the original source. 3. This Copyright notice may not be removed or altered from any source or altered source distribution. The Contributing Authors and Group 42, Inc. specifically permit, without fee, and encourage the use of this source code as a component to supporting the PNG file format in commercial products. If you use this source code in a product, acknowledgment is not required but would be appreciated. END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. TRADEMARK ========= The name "libpng" has not been registered by the Copyright owners as a trademark in any jurisdiction. However, because libpng has been distributed and maintained world-wide, continually since 1995, the Copyright owners claim "common-law trademark protection" in any jurisdiction where common-law trademark is recognized. ## Files: png.h A "png_get_copyright" function is available, for convenient use in "about" boxes and the like: printf("%s", png_get_copyright(NULL)); Also, the PNG logo (in PNG format, of course) is supplied in the files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). ## Files: png.h With all write APIs if image is in one of the linear formats with 16-bit data then setting convert_to_8_bit will cause the output to be an 8-bit PNG gamma encoded according to the sRGB specification, otherwise a 16-bit linear encoded PNG file is written. With color-mapped data formats the colormap parameter point to a color-map with at least image->colormap_entries encoded in the specified format. If the format is linear the written PNG color-map will be converted to sRGB regardless of the convert_to_8_bit flag. With all APIs row_stride is handled as in the read APIs - it is the spacing from one row to the next in component sized units (1 or 2 bytes) and if negative indicates a bottom-up row layout in the buffer. If row_stride is zero, libpng will calculate it for you from the image width and number of channels. Note that the write API does not support interlacing, sub-8-bit pixels or most ancillary chunks. If you need to write text chunks (e.g. for copyright notices) you need to use one of the other APIs. ## Files: pngconf.h pngconf.h - machine-configurable file for libpng libpng version 1.6.50 Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h Any machine specific code is near the front of this file, so if you are configuring libpng for a machine, you may want to read the section starting here down to where it starts to typedef png_color, png_text, and png_info. ## Files: pngdebug.h pngdebug.h - internal debugging macros for libpng Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pngerror.c pngerror.c - stub functions for i/o and memory allocation Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This file provides a location for all error handling. Users who need special error handling are expected to write replacement functions and use png_set_error_fn() to use those functions. See the instructions at each function. ## Files: pngget.c pngget.c - retrieval of values from info struct Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pnginfo.h pnginfo.h - internal structures for libpng Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2013,2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pngmem.c pngmem.c - stub functions for memory allocation Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This file provides a location for all memory allocation. Users who need special memory handling are expected to supply replacement functions for png_malloc() and png_free(), and to use png_create_read_struct_2() and png_create_write_struct_2() to identify the replacement functions. ## Files: pngpread.c pngpread.c - read a png file in push mode Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pngpriv.h pngpriv.h - private declarations for use inside libpng Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pngread.c pngread.c - read a PNG file Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This file contains routines that an application calls directly to read a PNG file or stream. ## Files: pngrio.c pngrio.c - functions for data input Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This file provides a location for all input. Users who need special handling are expected to write a function that has the same arguments as this and performs a similar function, but that possibly has a different input method. Note that you shouldn't change this function, but rather write a replacement function and then make libpng use it at run time with png_set_read_fn(...). ## Files: pngrtran.c pngrtran.c - transforms the data in a row for PNG readers Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This file contains functions optionally called by an application in order to tell libpng how to handle data when reading a PNG. Transformations that are used in both reading and writing are in pngtrans.c. ## Files: pngrutil.c pngrutil.c - utilities to read a PNG file Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This file contains routines that are only called from within libpng itself during the course of reading an image. ## Files: pngset.c pngset.c - storage of image information into info struct Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h The functions here are used during reads to store data from the file into the info struct, and during writes to store application data into the info struct for writing into the file. This abstracts the info struct and allows us to change the structure in the future. ## Files: pngstruct.h pngstruct.h - internal structures for libpng Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pngtest.c pngtest.c - a test program for libpng Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This program reads in a PNG image, writes it out again, and then compares the two files. If the files are identical, this shows that the basic chunk handling, filtering, and (de)compression code is working properly. It does not currently test all of the transforms, although it probably should. The program will report "FAIL" in certain legitimate cases: 1) when the compression level or filter selection method is changed. 2) when the maximum IDAT size (PNG_ZBUF_SIZE in pngconf.h) is not 8192. 3) unknown unsafe-to-copy ancillary chunks or unknown critical chunks exist in the input file. 4) others not listed here... In these cases, it is best to check with another tool such as "pngcheck" to see what the differences between the two files are. If a filename is given on the command-line, then this file is used for the input, rather than the default "pngtest.png". This allows testing a wide variety of files easily. You can also test a number of files at once by typing "pngtest -m file1.png file2.png ..." ## Files: pngtrans.c pngtrans.c - transforms the data in a row (used by both readers and writers) Copyright (c) 2018-2024 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pngwio.c pngwio.c - functions for data output Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2014,2016,2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This file provides a location for all output. Users who need special handling are expected to write functions that have the same arguments as these and perform similar functions, but that possibly use different output methods. Note that you shouldn't change these functions, but rather write replacement functions and then change them at run time with png_set_write_fn(...). ## Files: pngwrite.c pngwrite.c - general routines to write a PNG file Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pngwtran.c pngwtran.c - transforms the data in a row for PNG writers Copyright (c) 2018 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: pngwutil.c pngwutil.c - utilities to write a PNG file Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h This file contains routines that are only called from within libpng itself during the course of writing an image. ## Files: powerpc/filter_vsx_intrinsics.c filter_vsx_intrinsics.c - PowerPC optimised filter functions Copyright (c) 2018 Cosmin Truta Copyright (c) 2017 Glenn Randers-Pehrson Written by Vadim Barkov, 2017. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: powerpc/powerpc_init.c powerpc_init.c - POWERPC optimised filter functions Copyright (c) 2018 Cosmin Truta Copyright (c) 2017 Glenn Randers-Pehrson Written by Vadim Barkov, 2017. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: riscv/filter_rvv_intrinsics.c filter_rvv_intrinsics.c - RISC-V Vector optimized filter functions Copyright (c) 2023 Google LLC Written by Manfred SCHLAEGL, 2022 Dragoș Tiselice , May 2023. Filip Wasil , March 2025. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: riscv/riscv_init.c riscv_init.c - RISC-V Vector optimized filter functions Copyright (c) 2023 Google LLC Written by Dragoș Tiselice , May 2023. Filip Wasil , March 2025. This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: scripts/dfn.awk scripts/dfn.awk - process a .dfn file Copyright (c) 2013-2014 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: scripts/intprefix.c intprefix.c - generate an unprefixed internal symbol list Copyright (c) 2013-2014 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: scripts/options.awk scripts/options.awk - library build configuration control Copyright (c) 1998-2014 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: scripts/pngwin.rc ifdef PNG_USER_VERSIONINFO_LEGALTRADEMARKS ## Files: scripts/prefix.c prefix.c - generate an unprefixed symbol list Copyright (c) 2013-2014 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: scripts/sym.c sym.c - define format of libpng.sym Copyright (c) 2011-2014 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: scripts/symbols.c symbols.c - find all exported symbols Copyright (c) 2011-2014 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h ## Files: scripts/vers.c vers.c - define format of libpng.vers Copyright (c) 2011-2014 Glenn Randers-Pehrson This code is released under the libpng license. For conditions of distribution and use, see the disclaimer and license in png.h