mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Fixed some indentation to comply with our coding style (synced
with libpng-1.6.24beta05).
This commit is contained in:
parent
83ca33b017
commit
f1fb09c406
1
ANNOUNCE
1
ANNOUNCE
@ -1391,6 +1391,7 @@ Version 1.7.0beta82 [July 4, 2016]
|
|||||||
Fixed two Coverity issues in pngcp.c.
|
Fixed two Coverity issues in pngcp.c.
|
||||||
|
|
||||||
Version 1.7.0beta83 [July 4, 2016]
|
Version 1.7.0beta83 [July 4, 2016]
|
||||||
|
Fixed some indentation to comply with our coding style.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
1
CHANGES
1
CHANGES
@ -5691,6 +5691,7 @@ Version 1.7.0beta82 [July 4, 2016]
|
|||||||
Fixed two Coverity issues in pngcp.c.
|
Fixed two Coverity issues in pngcp.c.
|
||||||
|
|
||||||
Version 1.7.0beta83 [July 4, 2016]
|
Version 1.7.0beta83 [July 4, 2016]
|
||||||
|
Fixed some indentation to comply with our coding style.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
10
example.c
10
example.c
@ -375,7 +375,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
|
|||||||
* low byte.
|
* low byte.
|
||||||
*/
|
*/
|
||||||
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
||||||
png_set_scale_16(png_ptr);
|
png_set_scale_16(png_ptr);
|
||||||
#else
|
#else
|
||||||
png_set_strip_16(png_ptr);
|
png_set_strip_16(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
@ -383,12 +383,12 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
|
|||||||
/* Strip alpha bytes from the input data without combining with the
|
/* Strip alpha bytes from the input data without combining with the
|
||||||
* background (not recommended).
|
* background (not recommended).
|
||||||
*/
|
*/
|
||||||
png_set_strip_alpha(png_ptr);
|
png_set_strip_alpha(png_ptr);
|
||||||
|
|
||||||
/* Extract multiple pixels with bit depths of 1, 2, and 4 from a single
|
/* Extract multiple pixels with bit depths of 1, 2, and 4 from a single
|
||||||
* byte into separate bytes (useful for paletted and grayscale images).
|
* byte into separate bytes (useful for paletted and grayscale images).
|
||||||
*/
|
*/
|
||||||
png_set_packing(png_ptr);
|
png_set_packing(png_ptr);
|
||||||
|
|
||||||
/* Change the order of packed pixels to least significant bit first
|
/* Change the order of packed pixels to least significant bit first
|
||||||
* (not useful if you are using png_set_packing). */
|
* (not useful if you are using png_set_packing). */
|
||||||
@ -988,11 +988,11 @@ void write_png(char *file_name /* , ... other image information ... */)
|
|||||||
png_bytep row_pointers[height];
|
png_bytep row_pointers[height];
|
||||||
|
|
||||||
if (height > PNG_UINT_32_MAX/(sizeof (png_bytep)))
|
if (height > PNG_UINT_32_MAX/(sizeof (png_bytep)))
|
||||||
png_error (png_ptr, "Image is too tall to process in memory");
|
png_error (png_ptr, "Image is too tall to process in memory");
|
||||||
|
|
||||||
/* Set up pointers into your "image" byte array */
|
/* Set up pointers into your "image" byte array */
|
||||||
for (k = 0; k < height; k++)
|
for (k = 0; k < height; k++)
|
||||||
row_pointers[k] = image + k*width*bytes_per_pixel;
|
row_pointers[k] = image + k*width*bytes_per_pixel;
|
||||||
|
|
||||||
/* One of the following output methods is REQUIRED */
|
/* One of the following output methods is REQUIRED */
|
||||||
|
|
||||||
|
17
png.h
17
png.h
@ -286,8 +286,7 @@
|
|||||||
|
|
||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.7.0beta83"
|
#define PNG_LIBPNG_VER_STRING "1.7.0beta83"
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#define PNG_HEADER_VERSION_STRING " libpng version 1.7.0beta83 - July 4, 2016\n"
|
||||||
" libpng version 1.7.0beta83 - July 4, 2016\n"
|
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_SONUM 17
|
#define PNG_LIBPNG_VER_SONUM 17
|
||||||
#define PNG_LIBPNG_VER_DLLNUM 17
|
#define PNG_LIBPNG_VER_DLLNUM 17
|
||||||
@ -332,14 +331,14 @@
|
|||||||
* the library has been built.
|
* the library has been built.
|
||||||
*/
|
*/
|
||||||
#ifndef PNGLCONF_H
|
#ifndef PNGLCONF_H
|
||||||
/* If pnglibconf.h is missing, you can
|
/* If pnglibconf.h is missing, you can
|
||||||
* copy scripts/pnglibconf.h.prebuilt to pnglibconf.h
|
* copy scripts/pnglibconf.h.prebuilt to pnglibconf.h
|
||||||
*/
|
*/
|
||||||
# include "pnglibconf.h"
|
# include "pnglibconf.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PNG_VERSION_INFO_ONLY
|
#ifndef PNG_VERSION_INFO_ONLY
|
||||||
/* Machine specific configuration. */
|
/* Machine specific configuration. */
|
||||||
# include "pngconf.h"
|
# include "pngconf.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3872,9 +3871,9 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
|
|||||||
#define PNG_IMAGE_PNG_SIZE_MAX_(image, image_size)\
|
#define PNG_IMAGE_PNG_SIZE_MAX_(image, image_size)\
|
||||||
((8U/*sig*/+25U/*IHDR*/+16U/*gAMA*/+44U/*cHRM*/+12U/*IEND*/+\
|
((8U/*sig*/+25U/*IHDR*/+16U/*gAMA*/+44U/*cHRM*/+12U/*IEND*/+\
|
||||||
(((image).format&PNG_FORMAT_FLAG_COLORMAP)?/*colormap: PLTE, tRNS*/\
|
(((image).format&PNG_FORMAT_FLAG_COLORMAP)?/*colormap: PLTE, tRNS*/\
|
||||||
12U+3U*(image).colormap_entries/*PLTE data*/+\
|
12U+3U*(image).colormap_entries/*PLTE data*/+\
|
||||||
(((image).format&PNG_FORMAT_FLAG_ALPHA)?\
|
(((image).format&PNG_FORMAT_FLAG_ALPHA)?\
|
||||||
12U/*tRNS*/+(image).colormap_entries:0U):0U)+\
|
12U/*tRNS*/+(image).colormap_entries:0U):0U)+\
|
||||||
12U)+(12U*((image_size)/PNG_ZBUF_SIZE))/*IDAT*/+(image_size))
|
12U)+(12U*((image_size)/PNG_ZBUF_SIZE))/*IDAT*/+(image_size))
|
||||||
/* A helper for the following macro; if your compiler cannot handle the
|
/* A helper for the following macro; if your compiler cannot handle the
|
||||||
* following macro use this one with the result of
|
* following macro use this one with the result of
|
||||||
|
42
pngconf.h
42
pngconf.h
@ -188,27 +188,27 @@
|
|||||||
* compatible with GCC or Visual C because of different calling conventions.
|
* compatible with GCC or Visual C because of different calling conventions.
|
||||||
*/
|
*/
|
||||||
# if PNG_API_RULE == 2
|
# if PNG_API_RULE == 2
|
||||||
/* If this line results in an error, either because __watcall is not
|
/* If this line results in an error, either because __watcall is not
|
||||||
* understood or because of a redefine just below you cannot use *this*
|
* understood or because of a redefine just below you cannot use *this*
|
||||||
* build of the library with the compiler you are using. *This* build was
|
* build of the library with the compiler you are using. *This* build was
|
||||||
* build using Watcom and applications must also be built using Watcom!
|
* build using Watcom and applications must also be built using Watcom!
|
||||||
*/
|
*/
|
||||||
# define PNGCAPI __watcall
|
# define PNGCAPI __watcall
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
|
# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
|
||||||
# define PNGCAPI __cdecl
|
# define PNGCAPI __cdecl
|
||||||
# if PNG_API_RULE == 1
|
# if PNG_API_RULE == 1
|
||||||
/* If this line results in an error __stdcall is not understood and
|
/* If this line results in an error __stdcall is not understood and
|
||||||
* PNG_API_RULE should not have been set to '1'.
|
* PNG_API_RULE should not have been set to '1'.
|
||||||
*/
|
*/
|
||||||
# define PNGAPI __stdcall
|
# define PNGAPI __stdcall
|
||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
/* An older compiler, or one not detected (erroneously) above,
|
/* An older compiler, or one not detected (erroneously) above,
|
||||||
* if necessary override on the command line to get the correct
|
* if necessary override on the command line to get the correct
|
||||||
* variants for the compiler.
|
* variants for the compiler.
|
||||||
*/
|
*/
|
||||||
# ifndef PNGCAPI
|
# ifndef PNGCAPI
|
||||||
# define PNGCAPI _cdecl
|
# define PNGCAPI _cdecl
|
||||||
# endif
|
# endif
|
||||||
@ -225,10 +225,10 @@
|
|||||||
|
|
||||||
# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
|
# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
|
||||||
(defined(__BORLANDC__) && __BORLANDC__ < 0x500)
|
(defined(__BORLANDC__) && __BORLANDC__ < 0x500)
|
||||||
/* older Borland and MSC
|
/* older Borland and MSC
|
||||||
* compilers used '__export' and required this to be after
|
* compilers used '__export' and required this to be after
|
||||||
* the type.
|
* the type.
|
||||||
*/
|
*/
|
||||||
# ifndef PNG_EXPORT_TYPE
|
# ifndef PNG_EXPORT_TYPE
|
||||||
# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
|
# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
|
||||||
# endif
|
# endif
|
||||||
@ -244,9 +244,9 @@
|
|||||||
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
|
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
|
||||||
# define PNGAPI _System
|
# define PNGAPI _System
|
||||||
# else /* !Windows/x86 && !OS/2 */
|
# else /* !Windows/x86 && !OS/2 */
|
||||||
/* Use the defaults, or define PNG*API on the command line (but
|
/* Use the defaults, or define PNG*API on the command line (but
|
||||||
* this will have to be done for every compile!)
|
* this will have to be done for every compile!)
|
||||||
*/
|
*/
|
||||||
# endif /* other system, !OS/2 */
|
# endif /* other system, !OS/2 */
|
||||||
#endif /* !Windows/x86 */
|
#endif /* !Windows/x86 */
|
||||||
|
|
||||||
@ -267,7 +267,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef PNG_IMPEXP
|
#ifndef PNG_IMPEXP
|
||||||
# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
|
# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
|
||||||
/* This forces use of a DLL, disallowing static linking */
|
/* This forces use of a DLL, disallowing static linking */
|
||||||
# define PNG_IMPEXP PNG_DLL_IMPORT
|
# define PNG_IMPEXP PNG_DLL_IMPORT
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -340,7 +340,7 @@
|
|||||||
* less efficient code.
|
* less efficient code.
|
||||||
*/
|
*/
|
||||||
# if defined(__clang__) && defined(__has_attribute)
|
# if defined(__clang__) && defined(__has_attribute)
|
||||||
/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
|
/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
|
||||||
# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
|
# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
|
||||||
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
|
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
|
||||||
# endif
|
# endif
|
||||||
|
10
pngpriv.h
10
pngpriv.h
@ -1083,7 +1083,7 @@ PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr,
|
|||||||
#ifdef PNG_WRITE_cHRM_SUPPORTED
|
#ifdef PNG_WRITE_cHRM_SUPPORTED
|
||||||
PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr,
|
||||||
const png_xy *xy), PNG_EMPTY);
|
const png_xy *xy), PNG_EMPTY);
|
||||||
/* The xy value must have been previously validated */
|
/* The xy value must have been previously validated */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_WRITE_sRGB_SUPPORTED
|
#ifdef PNG_WRITE_sRGB_SUPPORTED
|
||||||
@ -1769,13 +1769,13 @@ PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr,
|
|||||||
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr,
|
||||||
png_inforp info_ptr), PNG_EMPTY);
|
png_inforp info_ptr), PNG_EMPTY);
|
||||||
/* Synchronize the info 'valid' flags with the colorspace */
|
/* Synchronize the info 'valid' flags with the colorspace */
|
||||||
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr,
|
||||||
png_inforp info_ptr), PNG_EMPTY);
|
png_inforp info_ptr), PNG_EMPTY);
|
||||||
/* Copy the png_struct colorspace to the info_struct and call the above to
|
/* Copy the png_struct colorspace to the info_struct and call the above to
|
||||||
* synchronize the flags. Checks for NULL info_ptr and does nothing.
|
* synchronize the flags. Checks for NULL info_ptr and does nothing.
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Added at libpng version 1.4.0 */
|
/* Added at libpng version 1.4.0 */
|
||||||
|
@ -1412,7 +1412,7 @@ png_image_skip_unused_chunks(png_structrp png_ptr)
|
|||||||
/* But do not ignore image data handling chunks */
|
/* But do not ignore image data handling chunks */
|
||||||
png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_AS_DEFAULT,
|
png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_AS_DEFAULT,
|
||||||
chunks_to_process, (int)/*SAFE*/(sizeof chunks_to_process)/5);
|
chunks_to_process, (int)/*SAFE*/(sizeof chunks_to_process)/5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# define PNG_SKIP_CHUNKS(p) png_image_skip_unused_chunks(p)
|
# define PNG_SKIP_CHUNKS(p) png_image_skip_unused_chunks(p)
|
||||||
|
6
pngset.c
6
pngset.c
@ -304,10 +304,10 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
|
|||||||
|
|
||||||
length = strlen(units) + 1;
|
length = strlen(units) + 1;
|
||||||
png_debug1(3, "allocating units for info (%lu bytes)",
|
png_debug1(3, "allocating units for info (%lu bytes)",
|
||||||
(unsigned long)length);
|
(unsigned long)length);
|
||||||
|
|
||||||
info_ptr->pcal_units = png_voidcast(png_charp,
|
info_ptr->pcal_units = png_voidcast(png_charp,
|
||||||
png_malloc_warn(png_ptr, length));
|
png_malloc_warn(png_ptr, length));
|
||||||
|
|
||||||
if (info_ptr->pcal_units == NULL)
|
if (info_ptr->pcal_units == NULL)
|
||||||
{
|
{
|
||||||
@ -1624,7 +1624,7 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_alloc_size_t size)
|
|||||||
png_error(png_ptr, "invalid compression buffer size");
|
png_error(png_ptr, "invalid compression buffer size");
|
||||||
|
|
||||||
# if (defined PNG_SEQUENTIAL_READ_SUPPORTED) || defined PNG_WRITE_SUPPORTED
|
# if (defined PNG_SEQUENTIAL_READ_SUPPORTED) || defined PNG_WRITE_SUPPORTED
|
||||||
png_ptr->IDAT_size = (png_uint_32)/*SAFE*/size;
|
png_ptr->IDAT_size = (png_uint_32)/*SAFE*/size;
|
||||||
# endif /* SEQUENTIAL_READ || WRITE */
|
# endif /* SEQUENTIAL_READ || WRITE */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
184
pngtest.c
184
pngtest.c
@ -130,13 +130,13 @@ static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present";
|
|||||||
static int
|
static int
|
||||||
tIME_to_str(png_structp png_ptr, png_charp ts, png_const_timep t)
|
tIME_to_str(png_structp png_ptr, png_charp ts, png_const_timep t)
|
||||||
{
|
{
|
||||||
png_const_charp str = png_convert_to_rfc1123(png_ptr, t);
|
png_const_charp str = png_convert_to_rfc1123(png_ptr, t);
|
||||||
|
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
strcpy(ts, str);
|
strcpy(ts, str);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* older libpng */
|
#endif /* older libpng */
|
||||||
#endif
|
#endif
|
||||||
@ -240,95 +240,95 @@ count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
|
|||||||
* png_byte pixel_depth bits per pixel (depth*channels)
|
* png_byte pixel_depth bits per pixel (depth*channels)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Counts the number of zero samples (or zero pixels if color_type is 3 */
|
/* Counts the number of zero samples (or zero pixels if color_type is 3 */
|
||||||
|
|
||||||
if (row_info->color_type == 0 || row_info->color_type == 3)
|
if (row_info->color_type == 0 || row_info->color_type == 3)
|
||||||
{
|
{
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
png_uint_32 n, nstop;
|
png_uint_32 n, nstop;
|
||||||
|
|
||||||
for (n = 0, nstop=row_info->width; n<nstop; n++)
|
for (n = 0, nstop=row_info->width; n<nstop; n++)
|
||||||
{
|
{
|
||||||
if (row_info->bit_depth == 1)
|
if (row_info->bit_depth == 1)
|
||||||
{
|
{
|
||||||
if (((*dp << pos++ ) & 0x80) == 0)
|
if (((*dp << pos++ ) & 0x80) == 0)
|
||||||
zero_samples++;
|
zero_samples++;
|
||||||
|
|
||||||
if (pos == 8)
|
if (pos == 8)
|
||||||
{
|
{
|
||||||
pos = 0;
|
pos = 0;
|
||||||
dp++;
|
dp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row_info->bit_depth == 2)
|
if (row_info->bit_depth == 2)
|
||||||
{
|
{
|
||||||
if (((*dp << (pos+=2)) & 0xc0) == 0)
|
if (((*dp << (pos+=2)) & 0xc0) == 0)
|
||||||
zero_samples++;
|
zero_samples++;
|
||||||
|
|
||||||
if (pos == 8)
|
if (pos == 8)
|
||||||
{
|
{
|
||||||
pos = 0;
|
pos = 0;
|
||||||
dp++;
|
dp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row_info->bit_depth == 4)
|
if (row_info->bit_depth == 4)
|
||||||
{
|
{
|
||||||
if (((*dp << (pos+=4)) & 0xf0) == 0)
|
if (((*dp << (pos+=4)) & 0xf0) == 0)
|
||||||
zero_samples++;
|
zero_samples++;
|
||||||
|
|
||||||
if (pos == 8)
|
if (pos == 8)
|
||||||
{
|
{
|
||||||
pos = 0;
|
pos = 0;
|
||||||
dp++;
|
dp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row_info->bit_depth == 8)
|
if (row_info->bit_depth == 8)
|
||||||
if (*dp++ == 0)
|
if (*dp++ == 0)
|
||||||
zero_samples++;
|
zero_samples++;
|
||||||
|
|
||||||
if (row_info->bit_depth == 16)
|
if (row_info->bit_depth == 16)
|
||||||
{
|
{
|
||||||
if ((*dp | *(dp+1)) == 0)
|
if ((*dp | *(dp+1)) == 0)
|
||||||
zero_samples++;
|
zero_samples++;
|
||||||
dp+=2;
|
dp+=2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /* Other color types */
|
else /* Other color types */
|
||||||
{
|
{
|
||||||
png_uint_32 n, nstop;
|
png_uint_32 n, nstop;
|
||||||
int channel;
|
int channel;
|
||||||
int color_channels = row_info->channels;
|
int color_channels = row_info->channels;
|
||||||
if (row_info->color_type > 3)
|
if (row_info->color_type > 3)
|
||||||
color_channels--;
|
color_channels--;
|
||||||
|
|
||||||
for (n = 0, nstop=row_info->width; n<nstop; n++)
|
for (n = 0, nstop=row_info->width; n<nstop; n++)
|
||||||
{
|
{
|
||||||
for (channel = 0; channel < color_channels; channel++)
|
for (channel = 0; channel < color_channels; channel++)
|
||||||
{
|
{
|
||||||
if (row_info->bit_depth == 8)
|
if (row_info->bit_depth == 8)
|
||||||
if (*dp++ == 0)
|
if (*dp++ == 0)
|
||||||
zero_samples++;
|
zero_samples++;
|
||||||
|
|
||||||
if (row_info->bit_depth == 16)
|
if (row_info->bit_depth == 16)
|
||||||
{
|
{
|
||||||
if ((*dp | *(dp+1)) == 0)
|
if ((*dp | *(dp+1)) == 0)
|
||||||
zero_samples++;
|
zero_samples++;
|
||||||
|
|
||||||
dp+=2;
|
dp+=2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (row_info->color_type > 3)
|
if (row_info->color_type > 3)
|
||||||
{
|
{
|
||||||
dp++;
|
dp++;
|
||||||
if (row_info->bit_depth == 16)
|
if (row_info->bit_depth == 16)
|
||||||
dp++;
|
dp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* WRITE_USER_TRANSFORM */
|
#endif /* WRITE_USER_TRANSFORM */
|
||||||
|
|
||||||
@ -926,7 +926,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
|
#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
|
||||||
init_callback_info(read_info_ptr);
|
init_callback_info(read_info_ptr);
|
||||||
png_set_read_user_chunk_fn(read_ptr, &user_chunk_data,
|
png_set_read_user_chunk_fn(read_ptr, &user_chunk_data,
|
||||||
read_user_chunk_callback);
|
read_user_chunk_callback);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
@ -1851,19 +1851,19 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (multiple == 0 && argc == 3 + verbose)
|
if (multiple == 0 && argc == 3 + verbose)
|
||||||
outname = argv[2 + verbose];
|
outname = argv[2 + verbose];
|
||||||
|
|
||||||
if ((multiple == 0 && argc > 3 + verbose) ||
|
if ((multiple == 0 && argc > 3 + verbose) ||
|
||||||
(multiple != 0 && argc < 2))
|
(multiple != 0 && argc < 2))
|
||||||
{
|
{
|
||||||
fprintf(STDERR,
|
fprintf(STDERR,
|
||||||
"usage: %s [infile.png] [outfile.png]\n\t%s -m {infile.png}\n",
|
"usage: %s [infile.png] [outfile.png]\n\t%s -m {infile.png}\n",
|
||||||
argv[0], argv[0]);
|
argv[0], argv[0]);
|
||||||
fprintf(STDERR,
|
fprintf(STDERR,
|
||||||
" reads/writes one PNG file (without -m) or multiple files (-m)\n");
|
" reads/writes one PNG file (without -m) or multiple files (-m)\n");
|
||||||
fprintf(STDERR,
|
fprintf(STDERR,
|
||||||
" with -m %s is used as a temporary file\n", outname);
|
" with -m %s is used as a temporary file\n", outname);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multiple != 0)
|
if (multiple != 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user