view release on metacpan or search on metacpan
.tmp/libpng/CHANGES view on Meta::CPAN
Revised the copyright/disclaimer/license notice.
Added contrib/msvctest directory
Version 1.0.7rc1 [June 9, 2000]
Corrected the definition of PNG_TRANSFORM_INVERT_ALPHA (0x0400 not 0x0200)
Added contrib/visupng directory (Willem van Schaik)
Version 1.0.7beta18 [June 23, 2000]
Revised PNGAPI definition, and pngvcrd.c to work with __GCC__
and do not redefine PNGAPI if it is passed in via a compiler directive.
Revised visupng/PngFile.c to remove returns from within the Try block.
Removed leading underscores from "_PNG_H" and "_PNG_SAVE_BSD_SOURCE" macros.
Updated contrib/visupng/cexcept.h to version 1.0.0.
Fixed bugs in pngwrite.c and pngwutil.c that prevented writing iCCP chunks.
Version 1.0.7rc2 [June 28, 2000]
Updated license to include disclaimers required by UCITA.
Fixed "DJBPP" typo in pnggccrd.c introduced in beta18.
Version 1.0.7 [July 1, 2000]
Revised the definition of "trans_values" in libpng.3/libpng.txt
.tmp/libpng/CHANGES view on Meta::CPAN
Version 1.0.10beta1 [March 14, 2001]
Revised makefile.dec, makefile.sgi, and makefile.sggcc; added makefile.hpgcc.
Reformatted libpng.3 to eliminate bad line breaks.
Added checks for _mmx_supported in the read_filter_row function of pnggccrd.c
Added prototype for png_mmx_support() near the top of pnggccrd.c
Moved some error checking from png_handle_IHDR to png_set_IHDR.
Added PNG_NO_READ_SUPPORTED and PNG_NO_WRITE_SUPPORTED macros.
Revised png_mmx_support() function in pnggccrd.c
Restored version 1.0.8 PNG_WRITE_EMPTY_PLTE_SUPPORTED behavior in pngwutil.c
Fixed memory leak in contrib/visupng/PngFile.c
Fixed bugs in png_combine_row() in pnggccrd.c and pngvcrd.c (C version)
Added warnings when retrieving or setting gamma=0.
Increased the first part of msg buffer from 16 to 18 in png_chunk_warning().
Version 1.0.10rc1 [March 23, 2001]
Changed all instances of memcpy, strcpy, and strlen to png_memcpy, png_strcpy,
and png_strlen.
Revised png_mmx_supported() function in pnggccrd.c to return proper value.
Fixed bug in progressive reading (pngpread.c) with small images (height < 8).
.tmp/libpng/CHANGES view on Meta::CPAN
Removed scripts/makefile.bd32 and scripts/pngdef.pas (Cosmin).
Added extra guard around inclusion of Turbo C memory headers, in pngconf.h
(Cosmin).
Renamed projects/msvc/ to projects/visualc6/, and projects/borland/ to
projects/cbuilder5/ (Cosmin).
Moved projects/visualc6/png32ms.def to scripts/pngw32.def,
and projects/visualc6/png.rc to scripts/pngw32.rc (Cosmin).
Added projects/visualc6/pngtest.dsp; removed contrib/msvctest/ (Cosmin).
Changed line endings to DOS style in cbuilder5 and visualc6 files, even
in the tar.* distributions (Cosmin).
Updated contrib/visupng/VisualPng.dsp (Cosmin).
Updated contrib/visupng/cexcept.h to version 2.0.0 (Cosmin).
Added a separate distribution with "configure" and supporting files (Junichi).
Version 1.2.6beta4 [July 28, 2004]
Added user ability to change png_size_t via a PNG_SIZE_T macro.
Added png_sizeof() and png_convert_size() functions.
Added PNG_SIZE_MAX (maximum value of a png_size_t variable.
Added check in png_malloc_default() for (size_t)size != (png_uint_32)size
which would indicate an overflow.
Changed sPLT failure action from png_error to png_warning and abandon chunk.
.tmp/libpng/CHANGES view on Meta::CPAN
colorspace (John Denker).
Changed line endings in some of the project files to CRLF, even in the
"Unix" tar distributions (Cosmin).
Made png_get_int_32 and png_save_int_32 always available (Cosmin).
Updated scripts/pngos2.def, scripts/pngw32.def and projects/wince/png32ce.def
with the newly exported functions.
Eliminated distributions without the "configure" script.
Updated INSTALL instructions.
Version 1.2.9beta3 [February 24, 2006]
Fixed CRCRLF line endings in contrib/visupng/VisualPng.dsp
Made libpng.pc respect EXEC_PREFIX (D. P. Kreil, J. Bowler)
Removed reference to pngasmrd.h from Makefile.am
Renamed CHANGES to ChangeLog.
Renamed LICENSE to COPYING.
Renamed ANNOUNCE to NEWS.
Created AUTHORS file.
Version 1.2.9beta4 [March 3, 2006]
Changed definition of PKGCONFIG from $prefix/lib to $libdir in configure.ac
Reverted to filenames LICENSE and ANNOUNCE; removed AUTHORS and COPYING.
.tmp/libpng/CHANGES view on Meta::CPAN
Changed "mkdir" to "MKDIR_P" in some makefiles.
Separated PNG_EXPAND and PNG_EXPAND_tRNS.
Added png_set_expand_gray_1_2_4_to_8() and deprecated
png_set_gray_1_2_4_to_8() which also expands tRNS to alpha.
Version 1.2.9beta9 [March 10, 2006]
Include "config.h" in pngconf.h when available.
Added some checks for NULL png_ptr or NULL info_ptr (timeless)
Version 1.2.9beta10 [March 20, 2006]
Removed extra CR from contrib/visualpng/VisualPng.dsw (Cosmin)
Made pnggccrd.c PIC-compliant (Christian Aichinger).
Added makefile.mingw (Wolfgang Glas).
Revised pngconf.h MMX checking.
Version 1.2.9beta11 [March 22, 2006]
Fixed out-of-order declaration in pngwrite.c that was introduced in beta9
Simplified some makefiles by using LIBSO, LIBSOMAJ, and LIBSOVER macros.
Version 1.2.9rc1 [March 31, 2006]
Defined PNG_USER_PRIVATEBUILD when including "pngusr.h" (Cosmin).
.tmp/libpng/CHANGES view on Meta::CPAN
was introduced in libpng-1.5.2beta01 (bug report by Andrew Church).
Version 1.5.3beta04 [April 27, 2011]
Updated pngtest.png with the new zlib CMF optimization.
Cleaned up conditional compilation code and of background/gamma handling
Internal changes only except a new option to avoid compiling the
png_build_grayscale_palette API (which is not used at all internally.)
The main change is to move the transform tests (READ_TRANSFORMS,
WRITE_TRANSFORMS) up one level to the caller of the APIs. This avoids
calls to spurious functions if all transforms are disabled and slightly
simplifies those functions. Pngvalid modified to handle this.
A minor change is to stop the strip_16 and expand_16 interfaces from
disabling each other; this allows the future alpha premultiplication
code to use 16-bit intermediate values while still producing 8-bit output.
png_do_background and png_do_gamma have been simplified to take a single
pointer to the png_struct rather than pointers to every item required
from the png_struct. This makes no practical difference to the internal
code.
A serious bug in the pngvalid internal routine 'standard_display_init' has
been fixed - this failed to initialize the red channel and accidentally
initialized the alpha channel twice.
.tmp/libpng/README view on Meta::CPAN
"PNG: The Definitive Guide" by Greg Roelofs,
O'Reilly, 1999
libtests/ => Test programs
pngexif/ => Program to inspect the EXIF information in PNG files
pngminim/ => Minimal decoder, encoder, and progressive decoder
programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs
pngsuite/ => Test images
testpngs/ => Test images
tools/ => Various tools
visupng/ => VisualPng, a Windows viewer for PNG images
projects/ => Project files and workspaces for various IDEs
owatcom/ => OpenWatcom project
visualc71/ => Microsoft Visual C++ 7.1 workspace
vstudio/ => Microsoft Visual Studio workspace
scripts/ => Scripts and makefiles for building libpng
(see scripts/README.txt for the complete list)
tests/ => Test scripts
Good luck, and happy coding!
.tmp/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc view on Meta::CPAN
png_handler.row_ptr = nullptr; \
png_handler.info_ptr = nullptr; \
png_handler.end_info_ptr = nullptr; \
}
struct BufState {
const uint8_t* data;
size_t bytes_left;
};
struct PngObjectHandler {
png_infop info_ptr = nullptr;
png_structp png_ptr = nullptr;
png_infop end_info_ptr = nullptr;
png_voidp row_ptr = nullptr;
BufState* buf_state = nullptr;
~PngObjectHandler() {
if (row_ptr)
png_free(png_ptr, row_ptr);
if (end_info_ptr)
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info_ptr);
else if (info_ptr)
png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
else
png_destroy_read_struct(&png_ptr, nullptr, nullptr);
delete buf_state;
}
.tmp/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc view on Meta::CPAN
if (size > 8000000)
return nullptr;
return malloc(size);
}
void default_free(png_structp, png_voidp ptr) {
return free(ptr);
}
static const int kPngHeaderSize = 8;
// Entry point for LibFuzzer.
// Roughly follows the libpng book example:
// http://www.libpng.org/pub/png/book/chapter13.html
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (size < kPngHeaderSize) {
return 0;
}
std::vector<unsigned char> v(data, data + size);
if (png_sig_cmp(v.data(), 0, kPngHeaderSize)) {
// not a PNG.
return 0;
}
PngObjectHandler png_handler;
png_handler.png_ptr = nullptr;
png_handler.row_ptr = nullptr;
png_handler.info_ptr = nullptr;
png_handler.end_info_ptr = nullptr;
png_handler.png_ptr = png_create_read_struct
(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (!png_handler.png_ptr) {
return 0;
}
.tmp/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc view on Meta::CPAN
// Use a custom allocator that fails for large allocations to avoid OOM.
png_set_mem_fn(png_handler.png_ptr, nullptr, limited_malloc, default_free);
png_set_crc_action(png_handler.png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
#ifdef PNG_IGNORE_ADLER32
png_set_option(png_handler.png_ptr, PNG_IGNORE_ADLER32, PNG_OPTION_ON);
#endif
// Setting up reading from buffer.
png_handler.buf_state = new BufState();
png_handler.buf_state->data = data + kPngHeaderSize;
png_handler.buf_state->bytes_left = size - kPngHeaderSize;
png_set_read_fn(png_handler.png_ptr, png_handler.buf_state, user_read_data);
png_set_sig_bytes(png_handler.png_ptr, kPngHeaderSize);
if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
PNG_CLEANUP
return 0;
}
// Reading.
png_read_info(png_handler.png_ptr, png_handler.info_ptr);
// reset error handler to put png_deleter into scope.
.tmp/libpng/contrib/pngminim/decoder/makefile view on Meta::CPAN
# Makefile for PngMinus (pngm2pnm)
# Linux / Unix
#CC=cc
CC=gcc
LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
.tmp/libpng/contrib/pngminim/encoder/makefile view on Meta::CPAN
# Makefile for PngMinus (pnm2pngm)
# Linux / Unix
#CC=cc
CC=gcc
LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
.tmp/libpng/contrib/pngminim/preader/makefile view on Meta::CPAN
# Makefile for PngMinus (rpng2)
# Linux / Unix
#CC=cc
CC=gcc
LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
.tmp/libpng/contrib/pngminus/README.txt view on Meta::CPAN
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
.tmp/libpng/contrib/pngminus/README.txt view on Meta::CPAN
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 <vbg> ... 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.
.tmp/libpng/contrib/pngsuite/README view on Meta::CPAN
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
------------ ------ --------------
.tmp/libpng/contrib/visupng/PngFile.c view on Meta::CPAN
#ifdef PNG_CONSOLE_IO_SUPPORTED
fprintf(stderr, "libpng error: %s\n", msg);
#endif
{
Throw msg;
}
}
/* Windows open-file functions */
void PngFileInitialize (HWND hwnd)
{
static TCHAR szFilter[] = TEXT ("PNG Files (*.PNG)\0*.png\0")
TEXT ("All Files (*.*)\0*.*\0\0");
ofn.lStructSize = sizeof (OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.hInstance = NULL;
ofn.lpstrFilter = szFilter;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
.tmp/libpng/contrib/visupng/PngFile.c view on Meta::CPAN
ofn.lpstrTitle = NULL;
ofn.Flags = 0; /* Set in Open and Close functions */
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = TEXT ("png");
ofn.lCustData = 0;
ofn.lpfnHook = NULL;
ofn.lpTemplateName = NULL;
}
BOOL PngFileOpenDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName)
{
ofn.hwndOwner = hwnd;
ofn.lpstrFile = pstrFileName;
ofn.lpstrFileTitle = pstrTitleName;
ofn.Flags = OFN_HIDEREADONLY;
return GetOpenFileName (&ofn);
}
BOOL PngFileSaveDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName)
{
ofn.hwndOwner = hwnd;
ofn.lpstrFile = pstrFileName;
ofn.lpstrFileTitle = pstrTitleName;
ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
return GetSaveFileName (&ofn);
}
/* PNG image handler functions */
BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
int *piWidth, int *piHeight, int *piChannels, png_color *pBkgColor)
{
static FILE *pfFile;
png_byte pbSig[8];
int iBitDepth;
int iColorType;
double dGamma;
png_color_16 *pBackground;
png_uint_32 ulChannels;
png_uint_32 ulRowBytes;
.tmp/libpng/contrib/visupng/PngFile.c view on Meta::CPAN
return FALSE;
}
fclose (pfFile);
return TRUE;
}
BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
int iWidth, int iHeight, png_color bkgColor)
{
const int ciBitDepth = 8;
const int ciChannels = 3;
static FILE *pfFile;
png_uint_32 ulRowBytes;
static png_byte **ppbRowPointers = NULL;
int i;
.tmp/libpng/contrib/visupng/PngFile.h view on Meta::CPAN
/* This code is released under the libpng license.*/
/* For conditions of distribution and use, see the disclaimer*/
/* and license in png.h*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
void PngFileInitialize (HWND hwnd) ;
BOOL PngFileOpenDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName) ;
BOOL PngFileSaveDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName) ;
BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
int *piWidth, int *piHeight, int *piChannels, png_color *pBkgColor);
BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
int iWidth, int iHeight, png_color BkgColor);
#ifndef PNG_STDIO_SUPPORTED
static void png_read_data(png_structp png_ptr, png_bytep data, size_t length);
static void png_write_data(png_structp png_ptr, png_bytep data, size_t length);
static void png_flush(png_structp png_ptr);
#endif
.tmp/libpng/contrib/visupng/README.txt view on Meta::CPAN
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
.tmp/libpng/contrib/visupng/README.txt view on Meta::CPAN
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
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
/*------------------------------------
* 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
*/
/* switches */
/* defines */
#define PROGNAME "VisualPng"
#define LONGNAME "Win32 Viewer for PNG-files"
#define VERSION "1.0 of 2000 June 07"
/* constants */
#define MARGIN 8
/* standard includes */
#include <stdio.h>
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
/* macros */
/* function prototypes */
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM) ;
BOOL CenterAbout (HWND hwndChild, HWND hwndParent);
BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
int *pFileIndex);
BOOL SearchPngList (TCHAR *pFileList, int FileCount, int *pFileIndex,
PTSTR pstrPrevName, PTSTR pstrNextName);
BOOL LoadImageFile(HWND hwnd, PTSTR pstrPathName,
png_byte **ppbImage, int *pxImgSize, int *pyImgSize, int *piChannels,
png_color *pBkgColor);
BOOL DisplayImage (HWND hwnd, BYTE **ppDib,
BYTE **ppDiData, int cxWinSize, int cyWinSize,
BYTE *pbImage, int cxImgSize, int cyImgSize, int cImgChannels,
BOOL bStretched);
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
static png_color bkgColor = {127, 127, 127};
static BOOL bStretched = TRUE;
static BYTE *pDib = NULL;
static BYTE *pDiData = NULL;
static TCHAR szImgPathName [MAX_PATH];
static TCHAR szTitleName [MAX_PATH];
static TCHAR *pPngFileList = NULL;
static int iPngFileCount;
static int iPngFileIndex;
BOOL bOk;
switch (message)
{
case WM_CREATE:
hInstance = ((LPCREATESTRUCT) lParam)->hInstance ;
PngFileInitialize (hwnd);
strcpy (szImgPathName, "");
/* in case we process file given on command-line */
if (szCmdFileName[0] != '\0')
{
strcpy (szImgPathName, szCmdFileName);
/* read the other png-files in the directory for later */
/* next/previous commands */
BuildPngList (szImgPathName, &pPngFileList, &iPngFileCount,
&iPngFileIndex);
/* load the image from file */
if (!LoadImageFile (hwnd, szImgPathName,
&pbImage, &cxImgSize, &cyImgSize, &cImgChannels, &bkgColor))
return 0;
/* invalidate the client area for later update */
InvalidateRect (hwnd, NULL, TRUE);
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
case WM_COMMAND:
hMenu = GetMenu (hwnd);
switch (LOWORD (wParam))
{
case IDM_FILE_OPEN:
/* show the File Open dialog box */
if (!PngFileOpenDlg (hwnd, szImgPathName, szTitleName))
return 0;
/* read the other png-files in the directory for later */
/* next/previous commands */
BuildPngList (szImgPathName, &pPngFileList, &iPngFileCount,
&iPngFileIndex);
/* load the image from file */
if (!LoadImageFile (hwnd, szImgPathName,
&pbImage, &cxImgSize, &cyImgSize, &cImgChannels, &bkgColor))
return 0;
/* invalidate the client area for later update */
InvalidateRect (hwnd, NULL, TRUE);
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize,
pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched);
return 0;
case IDM_FILE_SAVE:
/* show the File Save dialog box */
if (!PngFileSaveDlg (hwnd, szImgPathName, szTitleName))
return 0;
/* save the PNG to a disk file */
SetCursor (LoadCursor (NULL, IDC_WAIT));
ShowCursor (TRUE);
bOk = PngSaveImage (szImgPathName, pDiData, cxWinSize, cyWinSize,
bkgColor);
ShowCursor (FALSE);
SetCursor (LoadCursor (NULL, IDC_ARROW));
if (!bOk)
MessageBox (hwnd, TEXT ("Error in saving the PNG image"),
szProgName, MB_ICONEXCLAMATION | MB_OK);
return 0;
case IDM_FILE_NEXT:
/* read next entry in the directory */
if (SearchPngList (pPngFileList, iPngFileCount, &iPngFileIndex,
NULL, szImgPathName))
{
if (strcmp (szImgPathName, "") == 0)
return 0;
/* load the image from file */
if (!LoadImageFile (hwnd, szImgPathName, &pbImage,
&cxImgSize, &cyImgSize, &cImgChannels, &bkgColor))
return 0;
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize,
pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched);
}
return 0;
case IDM_FILE_PREVIOUS:
/* read previous entry in the directory */
if (SearchPngList (pPngFileList, iPngFileCount, &iPngFileIndex,
szImgPathName, NULL))
{
if (strcmp (szImgPathName, "") == 0)
return 0;
/* load the image from file */
if (!LoadImageFile (hwnd, szImgPathName, &pbImage, &cxImgSize,
&cyImgSize, &cImgChannels, &bkgColor))
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
/* free image buffer */
if (pDib != NULL)
{
free (pDib);
pDib = NULL;
}
/* free file-list */
if (pPngFileList != NULL)
{
free (pPngFileList);
pPngFileList = NULL;
}
/* let's go ... */
exit (0);
return 0;
case IDM_OPTIONS_STRETCH:
bStretched = !bStretched;
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
} else if ((yNew+hChild) > rWorkArea.bottom) {
yNew = rWorkArea.bottom - hChild;
}
/* Set it, and return */
return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE |
SWP_NOZORDER);
}
/*----------------
* BuildPngList
*----------------
*/
BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
int *pFileIndex)
{
static TCHAR szImgPathName [MAX_PATH];
static TCHAR szImgFileName [MAX_PATH];
static TCHAR szImgFindName [MAX_PATH];
WIN32_FIND_DATA finddata;
HANDLE hFind;
static TCHAR szTmp [MAX_PATH];
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
if (*pFileIndex == j)
*pFileIndex = i;
}
}
}
return TRUE;
}
/*----------------
* SearchPngList
*----------------
*/
BOOL SearchPngList (
TCHAR *pFileList, int FileCount, int *pFileIndex,
PTSTR pstrPrevName, PTSTR pstrNextName)
{
if (FileCount > 0)
{
/* get previous entry */
if (pstrPrevName != NULL)
{
if (*pFileIndex > 0)
.tmp/libpng/contrib/visupng/VisualPng.c view on Meta::CPAN
{
free (*ppbImage);
*ppbImage = NULL;
}
/* Load the entire PNG into memory */
SetCursor (LoadCursor (NULL, IDC_WAIT));
ShowCursor (TRUE);
PngLoadImage (pstrPathName, ppbImage, pxImgSize, pyImgSize, piChannels,
pBkgColor);
ShowCursor (FALSE);
SetCursor (LoadCursor (NULL, IDC_ARROW));
if (*ppbImage != NULL)
{
sprintf (szTmp, "VisualPng - %s", strrchr(pstrPathName, '\\') + 1);
SetWindowText (hwnd, szTmp);
}
else
{
MessageBox (hwnd, TEXT ("Error in loading the PNG image"),
szProgName, MB_ICONEXCLAMATION | MB_OK);
return FALSE;
}
return TRUE;
.tmp/libpng/contrib/visupng/VisualPng.dsp view on Meta::CPAN
# Microsoft Developer Studio Project File - Name="VisualPng" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=VisualPng - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "VisualPng.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "VisualPng.mak" CFG="VisualPng - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "VisualPng - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "VisualPng - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "VisualPng - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
.tmp/libpng/contrib/visupng/VisualPng.dsp view on Meta::CPAN
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 ..\..\projects\visualc6\Win32_LIB_Release\libpng.lib ..\..\..\zlib\projects\visualc6\Win32_LIB_Release\zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.l...
# Begin Special Build Tool
OutDir=.\Release
SOURCE="$(InputPath)"
PostBuild_Cmds=$(outdir)\VisualPng.exe ..\..\contrib\pngsuite\basn6a16.png
# End Special Build Tool
!ELSEIF "$(CFG)" == "VisualPng - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
.tmp/libpng/contrib/visupng/VisualPng.dsp view on Meta::CPAN
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\projects\visualc6\Win32_LIB_Release\libpng.lib ..\..\..\zlib\projects\visualc6\Win32_LIB_Release\zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.l...
# Begin Special Build Tool
OutDir=.\Debug
SOURCE="$(InputPath)"
PostBuild_Cmds=$(outdir)\VisualPng.exe ..\..\contrib\pngsuite\basn6a16.png
# End Special Build Tool
!ENDIF
# Begin Target
# Name "VisualPng - Win32 Release"
# Name "VisualPng - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\PngFile.c
# End Source File
# Begin Source File
SOURCE=.\VisualPng.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\cexcept.h
# End Source File
# Begin Source File
SOURCE=.\PngFile.h
# End Source File
# Begin Source File
SOURCE=.\resource.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\VisualPng.ico
# End Source File
# Begin Source File
SOURCE=.\VisualPng.rc
# End Source File
# End Group
# End Target
# End Project
.tmp/libpng/contrib/visupng/VisualPng.dsw view on Meta::CPAN
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "VisualPng"=.\VisualPng.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
.tmp/libpng/contrib/visupng/VisualPng.rc view on Meta::CPAN
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
VISUALPNG ICON DISCARDABLE "VisualPng.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
ABOUTBOX DIALOG DISCARDABLE 0, 0, 186, 94
STYLE DS_MODALFRAME | WS_POPUP
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,68,67,50,14
CTEXT "VisualPng 1.0 - June 2000",IDC_STATIC,49,14,88,8
LTEXT "a PNG image viewer",IDC_STATIC,60,30,66,8
LTEXT "(c) Willem van Schaik, 2000",IDC_STATIC,48,52,90,8
LTEXT "to demonstrate the use of libpng in Visual C",
IDC_STATIC,25,38,136,8
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
.tmp/libpng/contrib/visupng/resource.h view on Meta::CPAN
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by VisualPng.rc
//
#define IDM_FILE_OPEN 40001
#define IDM_FILE_SAVE 40002
#define IDM_FILE_NEXT 40003
#define IDM_FILE_PREVIOUS 40004
#define IDM_FILE_EXIT 40005
#define IDM_OPTIONS_BACKGROUND 40006
#define IDM_OPTIONS_STRETCH 40007
#define IDM_HELP_ABOUT 40008
.tmp/libpng/png.h view on Meta::CPAN
* the correct thing.
*/
PNG_EXPORT(175, void, png_set_unknown_chunk_location,
(png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location));
PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr,
png_inforp info_ptr, png_unknown_chunkpp entries));
#endif
/* Png_free_data() will turn off the "valid" flag for anything it frees.
* If you need to turn it off for a chunk that your application has freed,
* you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
*/
PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,
png_inforp info_ptr, int mask));
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* The "params" pointer is currently not used and is for future expansion. */
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,
.tmp/libpng/pngread.c view on Meta::CPAN
{
red = PNG_sRGB_FROM_LINEAR(red * 255);
green = PNG_sRGB_FROM_LINEAR(green * 255);
blue = PNG_sRGB_FROM_LINEAR(blue * 255);
encoding = P_sRGB;
}
}
else if (encoding == P_LINEAR8)
{
/* This encoding occurs quite frequently in test cases because PngSuite
* includes a gAMA 1.0 chunk with most images.
*/
red *= 257;
green *= 257;
blue *= 257;
alpha *= 257;
encoding = P_LINEAR;
}
else if (encoding == P_sRGB &&
.tmp/libpng/scripts/makefile.riscos view on Meta::CPAN
Run @.pngtest
@Remove @.pngtest
#It would be nice if you could stop "make" listing from here on!
@.pngtest: @.o.pngtest @.libpng-lib C:o.Stubs C:zlib.o.zlib
Link $(Linkflags) @.o.pngtest @.libpng-lib C:o.Stubs C:zlib.o.zlib
.SUFFIXES: .o .mm .c
.c.mm:
MemCheck.CC cc $(ccflags) -o $@ LibPng:$<
.c.o:
cc $(ccflags) -o $@ $<
# See scripts.pnglibconf/mak for how to generate this:
@.h.pnglibconf: @.scripts.pnglibconf/h/prebuilt
Copy @.scripts.pnglibconf/h/prebuilt $@ ~CF~V
# Static dependencies:
@.o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \
@.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \
.tmp/libpng/contrib/tools/genpng.c
.tmp/libpng/contrib/tools/intgamma.sh
.tmp/libpng/contrib/tools/makesRGB.c
.tmp/libpng/contrib/tools/png-fix-itxt.c
.tmp/libpng/contrib/tools/pngcp.c
.tmp/libpng/contrib/tools/pngfix.c
.tmp/libpng/contrib/tools/README.txt
.tmp/libpng/contrib/tools/sRGB.h
.tmp/libpng/contrib/visupng/.editorconfig
.tmp/libpng/contrib/visupng/cexcept.h
.tmp/libpng/contrib/visupng/PngFile.c
.tmp/libpng/contrib/visupng/PngFile.h
.tmp/libpng/contrib/visupng/README.txt
.tmp/libpng/contrib/visupng/resource.h
.tmp/libpng/contrib/visupng/VisualPng.c
.tmp/libpng/contrib/visupng/VisualPng.dsp
.tmp/libpng/contrib/visupng/VisualPng.dsw
.tmp/libpng/contrib/visupng/VisualPng.ico
.tmp/libpng/contrib/visupng/VisualPng.png
.tmp/libpng/contrib/visupng/VisualPng.rc
.tmp/libpng/depcomp
.tmp/libpng/example.c
.tmp/libpng/INSTALL
.tmp/libpng/install-sh
.tmp/libpng/intel/filter_sse2_intrinsics.c
.tmp/libpng/intel/intel_init.c
.tmp/libpng/libpng-config.in
.tmp/libpng/libpng-manual.txt
.tmp/libpng/libpng.3
.tmp/libpng/libpng.pc.in
lib/SPVM/Resource/Libpng.native/src/contrib/tools/genpng.c
lib/SPVM/Resource/Libpng.native/src/contrib/tools/intgamma.sh
lib/SPVM/Resource/Libpng.native/src/contrib/tools/makesRGB.c
lib/SPVM/Resource/Libpng.native/src/contrib/tools/png-fix-itxt.c
lib/SPVM/Resource/Libpng.native/src/contrib/tools/pngcp.c
lib/SPVM/Resource/Libpng.native/src/contrib/tools/pngfix.c
lib/SPVM/Resource/Libpng.native/src/contrib/tools/README.txt
lib/SPVM/Resource/Libpng.native/src/contrib/tools/sRGB.h
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/.editorconfig
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/cexcept.h
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/PngFile.c
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/PngFile.h
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/README.txt
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/resource.h
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/VisualPng.c
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/VisualPng.dsp
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/VisualPng.dsw
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/VisualPng.ico
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/VisualPng.png
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/VisualPng.rc
lib/SPVM/Resource/Libpng.native/src/depcomp
lib/SPVM/Resource/Libpng.native/src/example.c
lib/SPVM/Resource/Libpng.native/src/INSTALL
lib/SPVM/Resource/Libpng.native/src/install-sh
lib/SPVM/Resource/Libpng.native/src/intel/filter_sse2_intrinsics.c
lib/SPVM/Resource/Libpng.native/src/intel/intel_init.c
lib/SPVM/Resource/Libpng.native/src/libpng-config.in
lib/SPVM/Resource/Libpng.native/src/libpng-manual.txt
lib/SPVM/Resource/Libpng.native/src/libpng.3
lib/SPVM/Resource/Libpng.native/src/libpng.pc.in
lib/SPVM/Resource/Libpng.native/include/png.h view on Meta::CPAN
* the correct thing.
*/
PNG_EXPORT(175, void, png_set_unknown_chunk_location,
(png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location));
PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr,
png_inforp info_ptr, png_unknown_chunkpp entries));
#endif
/* Png_free_data() will turn off the "valid" flag for anything it frees.
* If you need to turn it off for a chunk that your application has freed,
* you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
*/
PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,
png_inforp info_ptr, int mask));
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* The "params" pointer is currently not used and is for future expansion. */
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,
lib/SPVM/Resource/Libpng.native/src/CHANGES view on Meta::CPAN
Revised the copyright/disclaimer/license notice.
Added contrib/msvctest directory
Version 1.0.7rc1 [June 9, 2000]
Corrected the definition of PNG_TRANSFORM_INVERT_ALPHA (0x0400 not 0x0200)
Added contrib/visupng directory (Willem van Schaik)
Version 1.0.7beta18 [June 23, 2000]
Revised PNGAPI definition, and pngvcrd.c to work with __GCC__
and do not redefine PNGAPI if it is passed in via a compiler directive.
Revised visupng/PngFile.c to remove returns from within the Try block.
Removed leading underscores from "_PNG_H" and "_PNG_SAVE_BSD_SOURCE" macros.
Updated contrib/visupng/cexcept.h to version 1.0.0.
Fixed bugs in pngwrite.c and pngwutil.c that prevented writing iCCP chunks.
Version 1.0.7rc2 [June 28, 2000]
Updated license to include disclaimers required by UCITA.
Fixed "DJBPP" typo in pnggccrd.c introduced in beta18.
Version 1.0.7 [July 1, 2000]
Revised the definition of "trans_values" in libpng.3/libpng.txt
lib/SPVM/Resource/Libpng.native/src/CHANGES view on Meta::CPAN
Version 1.0.10beta1 [March 14, 2001]
Revised makefile.dec, makefile.sgi, and makefile.sggcc; added makefile.hpgcc.
Reformatted libpng.3 to eliminate bad line breaks.
Added checks for _mmx_supported in the read_filter_row function of pnggccrd.c
Added prototype for png_mmx_support() near the top of pnggccrd.c
Moved some error checking from png_handle_IHDR to png_set_IHDR.
Added PNG_NO_READ_SUPPORTED and PNG_NO_WRITE_SUPPORTED macros.
Revised png_mmx_support() function in pnggccrd.c
Restored version 1.0.8 PNG_WRITE_EMPTY_PLTE_SUPPORTED behavior in pngwutil.c
Fixed memory leak in contrib/visupng/PngFile.c
Fixed bugs in png_combine_row() in pnggccrd.c and pngvcrd.c (C version)
Added warnings when retrieving or setting gamma=0.
Increased the first part of msg buffer from 16 to 18 in png_chunk_warning().
Version 1.0.10rc1 [March 23, 2001]
Changed all instances of memcpy, strcpy, and strlen to png_memcpy, png_strcpy,
and png_strlen.
Revised png_mmx_supported() function in pnggccrd.c to return proper value.
Fixed bug in progressive reading (pngpread.c) with small images (height < 8).
lib/SPVM/Resource/Libpng.native/src/CHANGES view on Meta::CPAN
Removed scripts/makefile.bd32 and scripts/pngdef.pas (Cosmin).
Added extra guard around inclusion of Turbo C memory headers, in pngconf.h
(Cosmin).
Renamed projects/msvc/ to projects/visualc6/, and projects/borland/ to
projects/cbuilder5/ (Cosmin).
Moved projects/visualc6/png32ms.def to scripts/pngw32.def,
and projects/visualc6/png.rc to scripts/pngw32.rc (Cosmin).
Added projects/visualc6/pngtest.dsp; removed contrib/msvctest/ (Cosmin).
Changed line endings to DOS style in cbuilder5 and visualc6 files, even
in the tar.* distributions (Cosmin).
Updated contrib/visupng/VisualPng.dsp (Cosmin).
Updated contrib/visupng/cexcept.h to version 2.0.0 (Cosmin).
Added a separate distribution with "configure" and supporting files (Junichi).
Version 1.2.6beta4 [July 28, 2004]
Added user ability to change png_size_t via a PNG_SIZE_T macro.
Added png_sizeof() and png_convert_size() functions.
Added PNG_SIZE_MAX (maximum value of a png_size_t variable.
Added check in png_malloc_default() for (size_t)size != (png_uint_32)size
which would indicate an overflow.
Changed sPLT failure action from png_error to png_warning and abandon chunk.
lib/SPVM/Resource/Libpng.native/src/CHANGES view on Meta::CPAN
colorspace (John Denker).
Changed line endings in some of the project files to CRLF, even in the
"Unix" tar distributions (Cosmin).
Made png_get_int_32 and png_save_int_32 always available (Cosmin).
Updated scripts/pngos2.def, scripts/pngw32.def and projects/wince/png32ce.def
with the newly exported functions.
Eliminated distributions without the "configure" script.
Updated INSTALL instructions.
Version 1.2.9beta3 [February 24, 2006]
Fixed CRCRLF line endings in contrib/visupng/VisualPng.dsp
Made libpng.pc respect EXEC_PREFIX (D. P. Kreil, J. Bowler)
Removed reference to pngasmrd.h from Makefile.am
Renamed CHANGES to ChangeLog.
Renamed LICENSE to COPYING.
Renamed ANNOUNCE to NEWS.
Created AUTHORS file.
Version 1.2.9beta4 [March 3, 2006]
Changed definition of PKGCONFIG from $prefix/lib to $libdir in configure.ac
Reverted to filenames LICENSE and ANNOUNCE; removed AUTHORS and COPYING.
lib/SPVM/Resource/Libpng.native/src/CHANGES view on Meta::CPAN
Changed "mkdir" to "MKDIR_P" in some makefiles.
Separated PNG_EXPAND and PNG_EXPAND_tRNS.
Added png_set_expand_gray_1_2_4_to_8() and deprecated
png_set_gray_1_2_4_to_8() which also expands tRNS to alpha.
Version 1.2.9beta9 [March 10, 2006]
Include "config.h" in pngconf.h when available.
Added some checks for NULL png_ptr or NULL info_ptr (timeless)
Version 1.2.9beta10 [March 20, 2006]
Removed extra CR from contrib/visualpng/VisualPng.dsw (Cosmin)
Made pnggccrd.c PIC-compliant (Christian Aichinger).
Added makefile.mingw (Wolfgang Glas).
Revised pngconf.h MMX checking.
Version 1.2.9beta11 [March 22, 2006]
Fixed out-of-order declaration in pngwrite.c that was introduced in beta9
Simplified some makefiles by using LIBSO, LIBSOMAJ, and LIBSOVER macros.
Version 1.2.9rc1 [March 31, 2006]
Defined PNG_USER_PRIVATEBUILD when including "pngusr.h" (Cosmin).
lib/SPVM/Resource/Libpng.native/src/CHANGES view on Meta::CPAN
was introduced in libpng-1.5.2beta01 (bug report by Andrew Church).
Version 1.5.3beta04 [April 27, 2011]
Updated pngtest.png with the new zlib CMF optimization.
Cleaned up conditional compilation code and of background/gamma handling
Internal changes only except a new option to avoid compiling the
png_build_grayscale_palette API (which is not used at all internally.)
The main change is to move the transform tests (READ_TRANSFORMS,
WRITE_TRANSFORMS) up one level to the caller of the APIs. This avoids
calls to spurious functions if all transforms are disabled and slightly
simplifies those functions. Pngvalid modified to handle this.
A minor change is to stop the strip_16 and expand_16 interfaces from
disabling each other; this allows the future alpha premultiplication
code to use 16-bit intermediate values while still producing 8-bit output.
png_do_background and png_do_gamma have been simplified to take a single
pointer to the png_struct rather than pointers to every item required
from the png_struct. This makes no practical difference to the internal
code.
A serious bug in the pngvalid internal routine 'standard_display_init' has
been fixed - this failed to initialize the red channel and accidentally
initialized the alpha channel twice.
lib/SPVM/Resource/Libpng.native/src/README view on Meta::CPAN
"PNG: The Definitive Guide" by Greg Roelofs,
O'Reilly, 1999
libtests/ => Test programs
pngexif/ => Program to inspect the EXIF information in PNG files
pngminim/ => Minimal decoder, encoder, and progressive decoder
programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs
pngsuite/ => Test images
testpngs/ => Test images
tools/ => Various tools
visupng/ => VisualPng, a Windows viewer for PNG images
projects/ => Project files and workspaces for various IDEs
owatcom/ => OpenWatcom project
visualc71/ => Microsoft Visual C++ 7.1 workspace
vstudio/ => Microsoft Visual Studio workspace
scripts/ => Scripts and makefiles for building libpng
(see scripts/README.txt for the complete list)
tests/ => Test scripts
Good luck, and happy coding!
lib/SPVM/Resource/Libpng.native/src/contrib/oss-fuzz/libpng_read_fuzzer.cc view on Meta::CPAN
png_handler.row_ptr = nullptr; \
png_handler.info_ptr = nullptr; \
png_handler.end_info_ptr = nullptr; \
}
struct BufState {
const uint8_t* data;
size_t bytes_left;
};
struct PngObjectHandler {
png_infop info_ptr = nullptr;
png_structp png_ptr = nullptr;
png_infop end_info_ptr = nullptr;
png_voidp row_ptr = nullptr;
BufState* buf_state = nullptr;
~PngObjectHandler() {
if (row_ptr)
png_free(png_ptr, row_ptr);
if (end_info_ptr)
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info_ptr);
else if (info_ptr)
png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
else
png_destroy_read_struct(&png_ptr, nullptr, nullptr);
delete buf_state;
}
lib/SPVM/Resource/Libpng.native/src/contrib/oss-fuzz/libpng_read_fuzzer.cc view on Meta::CPAN
if (size > 8000000)
return nullptr;
return malloc(size);
}
void default_free(png_structp, png_voidp ptr) {
return free(ptr);
}
static const int kPngHeaderSize = 8;
// Entry point for LibFuzzer.
// Roughly follows the libpng book example:
// http://www.libpng.org/pub/png/book/chapter13.html
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (size < kPngHeaderSize) {
return 0;
}
std::vector<unsigned char> v(data, data + size);
if (png_sig_cmp(v.data(), 0, kPngHeaderSize)) {
// not a PNG.
return 0;
}
PngObjectHandler png_handler;
png_handler.png_ptr = nullptr;
png_handler.row_ptr = nullptr;
png_handler.info_ptr = nullptr;
png_handler.end_info_ptr = nullptr;
png_handler.png_ptr = png_create_read_struct
(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (!png_handler.png_ptr) {
return 0;
}
lib/SPVM/Resource/Libpng.native/src/contrib/oss-fuzz/libpng_read_fuzzer.cc view on Meta::CPAN
// Use a custom allocator that fails for large allocations to avoid OOM.
png_set_mem_fn(png_handler.png_ptr, nullptr, limited_malloc, default_free);
png_set_crc_action(png_handler.png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
#ifdef PNG_IGNORE_ADLER32
png_set_option(png_handler.png_ptr, PNG_IGNORE_ADLER32, PNG_OPTION_ON);
#endif
// Setting up reading from buffer.
png_handler.buf_state = new BufState();
png_handler.buf_state->data = data + kPngHeaderSize;
png_handler.buf_state->bytes_left = size - kPngHeaderSize;
png_set_read_fn(png_handler.png_ptr, png_handler.buf_state, user_read_data);
png_set_sig_bytes(png_handler.png_ptr, kPngHeaderSize);
if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
PNG_CLEANUP
return 0;
}
// Reading.
png_read_info(png_handler.png_ptr, png_handler.info_ptr);
// reset error handler to put png_deleter into scope.
lib/SPVM/Resource/Libpng.native/src/contrib/pngminim/decoder/makefile view on Meta::CPAN
# Makefile for PngMinus (pngm2pnm)
# Linux / Unix
#CC=cc
CC=gcc
LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
lib/SPVM/Resource/Libpng.native/src/contrib/pngminim/encoder/makefile view on Meta::CPAN
# Makefile for PngMinus (pnm2pngm)
# Linux / Unix
#CC=cc
CC=gcc
LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
lib/SPVM/Resource/Libpng.native/src/contrib/pngminim/preader/makefile view on Meta::CPAN
# Makefile for PngMinus (rpng2)
# Linux / Unix
#CC=cc
CC=gcc
LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
lib/SPVM/Resource/Libpng.native/src/contrib/pngminus/README.txt view on Meta::CPAN
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
lib/SPVM/Resource/Libpng.native/src/contrib/pngminus/README.txt view on Meta::CPAN
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 <vbg> ... 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.
lib/SPVM/Resource/Libpng.native/src/contrib/pngsuite/README view on Meta::CPAN
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
------------ ------ --------------
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/PngFile.c view on Meta::CPAN
#ifdef PNG_CONSOLE_IO_SUPPORTED
fprintf(stderr, "libpng error: %s\n", msg);
#endif
{
Throw msg;
}
}
/* Windows open-file functions */
void PngFileInitialize (HWND hwnd)
{
static TCHAR szFilter[] = TEXT ("PNG Files (*.PNG)\0*.png\0")
TEXT ("All Files (*.*)\0*.*\0\0");
ofn.lStructSize = sizeof (OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.hInstance = NULL;
ofn.lpstrFilter = szFilter;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/PngFile.c view on Meta::CPAN
ofn.lpstrTitle = NULL;
ofn.Flags = 0; /* Set in Open and Close functions */
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = TEXT ("png");
ofn.lCustData = 0;
ofn.lpfnHook = NULL;
ofn.lpTemplateName = NULL;
}
BOOL PngFileOpenDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName)
{
ofn.hwndOwner = hwnd;
ofn.lpstrFile = pstrFileName;
ofn.lpstrFileTitle = pstrTitleName;
ofn.Flags = OFN_HIDEREADONLY;
return GetOpenFileName (&ofn);
}
BOOL PngFileSaveDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName)
{
ofn.hwndOwner = hwnd;
ofn.lpstrFile = pstrFileName;
ofn.lpstrFileTitle = pstrTitleName;
ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
return GetSaveFileName (&ofn);
}
/* PNG image handler functions */
BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
int *piWidth, int *piHeight, int *piChannels, png_color *pBkgColor)
{
static FILE *pfFile;
png_byte pbSig[8];
int iBitDepth;
int iColorType;
double dGamma;
png_color_16 *pBackground;
png_uint_32 ulChannels;
png_uint_32 ulRowBytes;
lib/SPVM/Resource/Libpng.native/src/contrib/visupng/PngFile.c view on Meta::CPAN
return FALSE;
}
fclose (pfFile);
return TRUE;
}
BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
int iWidth, int iHeight, png_color bkgColor)
{
const int ciBitDepth = 8;
const int ciChannels = 3;
static FILE *pfFile;
png_uint_32 ulRowBytes;
static png_byte **ppbRowPointers = NULL;
int i;