example.c

Branch


Log

Author Commit Date CI Message
Chris Blume 7101a556 2025-04-08T08:08:20 Correct mistake in example.c
Cosmin Truta 44f97f08 2025-02-21T15:34:09 [libpng18] chore: Clean up the `FILE *` formulations in code and in documentation We should use `FILE *` instead of `FILE*` or `(FILE*)`, consistently, as we should for all other pointer types. Moreover, when we refer to standard stdio file objects in comments and in documentation, we should use the term "FILE objects" consistently. Lastly, we clarify in a comment in example.c that `PNG_STDIO_SUPPORTED` is true only when the stdio support is both available in the system and accessible in the user's libpng build. This is a cherry-pick of commit c63c5463903014c904b540216c2784023fb8c1c8 from branch 'libpng18'. Reviewed-by: John Bowler <jbowler@acm.org> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
John Bowler d7d950e8 2024-10-10T14:09:02 [libpng16] chore: Clean up the leading blank lines from all source files The leading blank lines are apparently an artefact of an older source control system. They are not required and they look like accidents, because starting a source file with a blank line is not a regular habit of software developers nowadays. This is a cherry-pick of commit 37cc20add8fb5b83bb5299a26cd3b41e0f776017 from branch 'libpng18'. Signed-off-by: John Bowler <jbowler@acm.org> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
Cosmin Truta 27e548af 2024-01-23T21:25:03 chore: Clean up the return statements and update example.c accordingly
Zack Middleton 6dd99ca9 2019-08-02T18:37:04 Fix example.c
Cosmin Truta 85acd919 2018-12-01T09:36:00 [master] Imported from libpng-1.6.36.tar
Cosmin Truta 81a65de2 2018-11-25T20:27:04 Clean up config, scripts, examples, etc.
Cosmin Truta a8738932 2018-07-28T18:47:21 Remove the "last changed" version information from source comments This information is maintained by the version control system.
Cosmin Truta 8da39742 2018-07-15T23:58:00 [master] Imported from libpng-1.6.35.tar
Cosmin Truta 46aedd89 2018-07-15T23:58:00 Release libpng version 1.6.35
Cosmin Truta a74aa9a0 2018-06-17T22:37:44 [libpng16] Replace the remaining uses of png_size_t with size_t In v1.6.0, size_t became a required type. It should be used consistently. To maintain backwards compatibility, png_size_t is still maintained in deprecated form.
Glenn Randers-Pehrson fbff8986 2017-07-27T05:25:33 [master] Imported from libpng-1.6.31.tar
Glenn Randers-Pehrson 1ed0b3f7 2017-07-25T15:32:19 [libpng16] Fixed typo in example.c (png_free_image should be png_image_free) (Bug report by John Smith)
Glenn Randers-Pehrson 8c552ddf 2017-06-28T13:46:04 [master] Imported from libpng-1.6.30.tar
Glenn Randers-Pehrson 2eff8ef5 2017-04-22T15:30:52 [libpng16] Imported from libpng-1.6.30beta02.tar
Glenn Randers-Pehrson 0c29ab2b 2016-08-03T21:16:26 [master] Imported from libpng-1.6.24.tar
Glenn Randers-Pehrson b50d5cea 2016-08-03T21:16:26 [libpng16] Imported from libpng-1.6.24.tar
Glenn Randers-Pehrson dd70604c 2016-07-15T11:20:46 [libpng16] Fixed more indentation
Glenn Randers-Pehrson 7a18a2de 2016-07-13T16:26:00 [libpng16] Undo bad indentation change in example.c
Glenn Randers-Pehrson 192e92d6 2016-07-13T14:43:42 [libpng16] Fixed some indentation to comply with our coding style.
Glenn Randers-Pehrson b9c62013 2015-11-12T07:00:12 [master] Imported from libpng-1.6.19.tar
Glenn Randers-Pehrson 01a0e806 2015-09-24T22:39:53 [libpng16] Reverted addition of png_set_filler_16 and png_set_add_alpha_16() functions. They unnecessarily duplicate png_set_filler() and png_set_add_alpha() which now work properly with 16-bit images.
Glenn Randers-Pehrson efe4e5d1 2015-09-23T22:08:04 [libpng16] Reverted the fix of byte order in png_do_read_filler() with 16-bit input that was made in version 1.6.17beta01, to preserve legacy behavior even though it was incorrect. Instead, added new API png_set_filter_16() and png_set_add_alpha_16() that set a flag to make png_do_read_filter() interpret the filler bytes properly.
Glenn Randers-Pehrson a8242fe6 2015-08-17T20:46:27 [libng16] Reverted recent mistaken change of 0xnnnn to 0xnnnnUL
Glenn Randers-Pehrson 8b83ff37 2015-08-13T20:57:18 [libpng16] Change "n bit" to "n-bit" in comments.
Glenn Randers-Pehrson da7a1e79 2014-11-20T09:33:25 [master] Imported from libpng-1.6.15.tar
Glenn Randers-Pehrson e8ef689c 2014-11-20T09:33:25 [libpng16] Imported from libpng-1.6.15.tar
Glenn Randers-Pehrson 985dc00f 2014-11-06T23:17:35 [libpng16] Fix typo in example.c
Glenn Randers-Pehrson cda68df8 2014-11-06T22:11:39 [libpng16] Changed "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */"
Glenn Randers-Pehrson 61ea3eac 2014-11-06T06:39:56 [libpng16] Reverted use png_get_libpng_ver(NULL) instead of PNG_LIBPNG_VER_STRING in the manual, example.c, pngtest.c, and applications in the contrib directory. It was incorrect advice.
Glenn Randers-Pehrson f1b547a5 2014-11-04T23:33:46 [libpng16] Use png_get_libpng_ver(NULL), not PNG_LIBPNG_VER_STRING
Glenn Randers-Pehrson 5d713fe1 2014-10-31T20:48:55 [libpng16] Changed remaining "if (!x)" to "if (x == 0)" and "if (x)" to "if (x !== 0)"
Glenn Randers-Pehrson eed640db 2014-10-22T19:28:06 [master] Imported from libpng-1.6.14.tar
Glenn Randers-Pehrson 6cae24c2 2014-10-13T11:11:21 [libpng16] Fixed some typos in comments.
Glenn Randers-Pehrson a11cd841 2014-10-05T13:45:38 [libpng16] Only mark text chunks as written after successfully writing them.
Glenn Randers-Pehrson d55c4f32 2014-08-21T05:53:38 [master] Imported from libpng-1.6.13.tar
Glenn Randers-Pehrson 212fd574 2014-06-11T21:10:16 [libpng16] Bump version to 1.6.13beta01
Glenn Randers-Pehrson 238e7646 2014-06-11T20:35:18 [master] Imported from libpng-1.6.12.tar
Glenn Randers-Pehrson e429c66c 2014-06-11T20:35:18 [libpng16] Imported from libpng-1.6.12.tar
Glenn Randers-Pehrson da7b692c 2014-06-06T11:42:50 [libpng16] Bump version to 1.6.12beta01
Glenn Randers-Pehrson d21eae44 2014-06-05T09:53:19 [master] Imported from libpng-1.6.11.tar
Glenn Randers-Pehrson c4e0f3de 2014-06-05T09:53:19 [libpng16] Imported from libpng-1.6.11.tar
Glenn Randers-Pehrson 05670156 2014-03-08T12:39:52 [libpng16] Use "if (value != 0)" instead of "if (value)" consistently.
Glenn Randers-Pehrson fca68966 2013-07-17T19:03:02 [master] Imported from libpng-1.6.3.tar
Glenn Randers-Pehrson 847e9efb 2013-07-17T19:03:02 [libpng16] Imported from libpng-1.6.3.tar
Glenn Randers-Pehrson 56a1a666 2013-06-27T16:56:16 [libpng16] Imported from libpng-1.6.3beta09.tar
Glenn Randers-Pehrson b0d97356 2013-06-25T19:36:15 [libpng16] Revised example.c to illustrate use of PNG_DEFAULT_sRGB and PNG_GAMMA_MAC_18 as parameters for png_set_gamma().
Glenn Randers-Pehrson 871b1d0f 2013-03-02T14:58:22 [libpng16] Bump version to 1.6.1beta05
Glenn Randers-Pehrson f3af706c 2012-02-02T23:11:45 [libpng16] Imported from libpng-1.6.0beta05.tar
Glenn Randers-Pehrson 0da9cf38 2013-02-13T22:49:19 [master] Imported from libpng-1.6.0.tar
Glenn Randers-Pehrson c53778ff 2013-02-13T22:49:09 [libpng16] Imported from libpng-1.6.0.tar
Glenn Randers-Pehrson 9477ecdf 2013-01-01T07:45:42 [libpng16] Updated copyright year to 2013 in newly-changed files
Glenn Randers-Pehrson c2ac10b5 2012-09-27T06:21:28 [master] Imported from libpng-1.5.13.tar
John Bowler ed3ca0e3 2012-08-31T17:32:36 [libpng16] Fixed the simplified API example programs and improved the error message if the version field is not set.
Glenn Randers-Pehrson 432c174b 2012-08-09T20:14:48 [libpng16] Eliminated use of png_sizeof(); use sizeof() instead, and use. a consistent style for (sizeof type) and (sizeof (array))
Glenn Randers-Pehrson cad0150d 2012-08-08T21:11:55 [libpng16] Corrected handling of row_pointers in example.c and added some comments. It has apparently been wrong since libpng-1.0.1c (confusing use of a 1D and a 2D array for the image source).
Glenn Randers-Pehrson d5a80e09 2012-03-29T00:07:04 [master] Imported from libpng-1.5.10.tar
Glenn Randers-Pehrson 5a13159b 2012-03-19T06:19:40 [master] Imported from libpng-1.5.10rc01.tar
Glenn Randers-Pehrson 42ed02ed 2012-03-16T23:17:27 [libpng16] Reverted png_set_itxt(); it would not compile without warnings.
Glenn Randers-Pehrson 31d66245 2012-03-16T13:53:25 [libpng16] Added png_set_itxt() (work in progress)
Glenn Randers-Pehrson f2715a55 2012-03-15T19:52:03 [libpng16] Revised example.c to put text strings in a temporary character array instead of directly assigning string constants to png_textp members. This avoids compiler warnings when -Wwrite-strings is enabled.
Glenn Randers-Pehrson 1531bd61 2012-01-01T14:45:04 [libpng16] Updated copyright year to 2012
John Bowler fcd301da 2011-12-28T21:34:27 [libpng16] Changed png_memcpy to C assignment where appropriate. Changed all those uses of png_memcpy that were doing a simple assignment to assignments (all those cases where the thing being copied is a non-array C L-value.) Added some error checking to png_set_*() routines and removed the reference to the non-exported function png_memcpy() from example.c. Fixed the Visual C 64-bit build - it requires jmp_buf to be aligned, but it had become misaligned.
John Bowler 5d56786e 2011-12-24T09:12:00 [libpng16] Implemented 'restrict' for png_info and png_struct. Added new "png_structrp" typedef. Because of the way libpng works both png_info and png_struct are always accessed via a single pointer. This means adding C99 'restrict' to the pointer gives the compiler some opportunity to optimize the code. This change allows that.
Glenn Randers-Pehrson 13831bc0 2011-12-21T08:28:28 [libpng16] Updated "last changed" dates
Glenn Randers-Pehrson cd3f5bb5 2011-12-08T08:50:29 [libpng15] Imported from libpng-1.5.7.tar
John Bowler 414769b4 2011-11-27T21:39:13 [libpng16] Add "free()" and "png_free_image()" calls to example code.
Glenn Randers-Pehrson 2ddb252d 2011-11-25T07:27:51 [libpng16] Updated license info in contrib/examples and example.c
Glenn Randers-Pehrson cc1fa5df 2011-11-25T06:35:30 [libpng15] Imported from libpng-1.5.7beta05.tar
Glenn Randers-Pehrson 7455cbf4 2011-11-24T14:40:36 [libpng16] Update internal version numbering and SO-numbers
Glenn Randers-Pehrson 55e85c24 2011-11-04T13:34:48 [libpng15] Imported from libpng-1.5.7beta01.tar
Glenn Randers-Pehrson 2b7d730e 2011-11-02T23:06:45 [libpng15] Bump version to libpng-1.5.7beta01
Glenn Randers-Pehrson bc6726bc 2011-11-02T22:43:00 [libpng15] Imported from libpng-1.5.6.tar
Glenn Randers-Pehrson 4daae301 2011-10-06T21:37:47 [libpng15] #ifdef out png_progressive_combine_row() when interlacing is not supported.
Glenn Randers-Pehrson d404b6d4 2011-07-07T06:24:57 [devel] Imported from libpng-1.5.4.tar
John Bowler 8d261262 2011-06-18T13:37:11 [devel] Fixed pngvalid, simplified macros, added checking for 0 in sCAL.
Glenn Randers-Pehrson ab63dd08 2011-06-17T20:04:17 [devel] Renamed png_set_chop_16() to png_set_strip_16().
Glenn Randers-Pehrson 857dbbe7 2011-06-16T09:39:40 [devel] Revised example.c to demonstrate png_set_chop_16().
John Bowler 550bab03 2011-06-14T06:17:26 [devel] Removed the ACCURATE and LEGACY options (they are no longer useable) Fixed some compiliation problems with scaling options.
Glenn Randers-Pehrson e1018a5b 2011-05-05T21:03:07 [devel] Imported from libpng-1.5.3beta05.tar
Glenn Randers-Pehrson dcc3505c 2011-03-31T11:23:49 [devel] Imported from libpng-1.5.2.tar
Glenn Randers-Pehrson f5ea1b70 2011-01-06T06:42:51 [devel] Imported from libpng-1.5.0.tar
Glenn Randers-Pehrson 64b863cd 2011-01-04T09:57:06 [devel] Update copyright year and bump to version libpng-1.5.0rc07
Glenn Randers-Pehrson f3abb2c3 2010-10-17T12:51:53 [devel] Rename libpng.txt to libpng-manual.txt
Glenn Randers-Pehrson f0eda4e8 2010-10-15T15:01:57 [devel] Imported from libpng-1.5.0beta51.tar
Glenn Randers-Pehrson 7e1fabe2 2010-10-14T07:29:03 [devel] Imported from libpng-1.5.0beta50.tar
Glenn Randers-Pehrson 1b49a71d 2010-10-07T20:59:06 [devel] Imported from libpng-1.5.0beta49.tar
Glenn Randers-Pehrson 83b4fc4a 2010-10-04T23:03:24 [devel] Imported from libpng-1.5.0beta48.tar
Glenn Randers-Pehrson b0876110 2010-10-04T17:24:36 [devel] Fixed problem with symbols creation in Makefile.am which was assuming that CCP writes to standard output by default (Martin Banky).
Glenn Randers-Pehrson bcb3aac3 2010-09-10T22:05:27 [devel] Fixed a number of problems with 64-bit compilation reported by Visual Studio 2010 (John Bowler).
Glenn Randers-Pehrson 39515c9e 2010-08-28T06:21:35 [devel] Imported from libpng-1.5.0beta46.tar
Glenn Randers-Pehrson a7119547 2010-08-26T07:07:37 [devel] Imported from libpng-1.5.0beta45.tar
Glenn Randers-Pehrson 9b362b1e 2010-08-24T09:03:56 [devel] Bump to version libpng-1.5.0beta45
Glenn Randers-Pehrson 363f96e7 2010-08-11T09:00:26 [devel] Imported from libpng-1.5.0beta41.tar
Glenn Randers-Pehrson 836fe66e 2010-08-06T06:52:34 [devel] Imported from libpng-1.5.0beta40.tar
Glenn Randers-Pehrson 2c700f97 2010-08-02T07:42:08 [devel] Imported from libpng-1.5.0beta39.tar
Glenn Randers-Pehrson bdabd8f7 2010-07-31T07:16:11 [devel] Bump to version libpng-1.5.0beta38
Glenn Randers-Pehrson 6c47e84d 2010-07-29T19:00:42 [devel] Bump to version libpng-1.5.0beta36
Glenn Randers-Pehrson 31aee0d0 2010-07-29T17:39:14 [devel] Fixed point APIs are now supported throughout (no missing APIs). Internal fixed point arithmetic support exists for all internal floating point operations. sCAL validates the floating point strings it is passed. Safe, albeit rudimentary, Watcom support is provided by PNG_API_RULE==2 Two new APIs exist to get the number of passes without turning on the PNG_INTERLACE transform and to get the number of rows in the current pass. A new test program, pngvalid.c, validates the gamma code. Errors in the 16 bit gamma correction (overflows) have been corrected. cHRM chunk testing is done consistently (previously the floating point API bypassed it, because the test really didn't work on FP, now the test is performed on the actual values to be stored in the PNG file so it works in the FP case too.) Most floating point APIs now simply call the fixed point APIs after converting the values to the fixed point form used in the PNG file. The standard headers no longer include zlib.h, which is currently only required for pngstruct.h and can therefore be internal. (Patches by John Bowler)
Glenn Randers-Pehrson 915bab5f 2010-07-24T08:22:59 [devel] Bump to version libpng-1.5.0beta35