mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.2.0beta3.tar
This commit is contained in:
12
pngwutil.c
12
pngwutil.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* libpng 1.2.0beta2 - May 7, 2001
|
||||
* libpng 1.2.0beta3 - May 18, 2001
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@@ -460,7 +460,9 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
||||
png_ptr->bit_depth = (png_byte)bit_depth;
|
||||
png_ptr->color_type = (png_byte)color_type;
|
||||
png_ptr->interlaced = (png_byte)interlace_type;
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
||||
png_ptr->filter_type = (png_byte)filter_type;
|
||||
#endif
|
||||
png_ptr->width = width;
|
||||
png_ptr->height = height;
|
||||
|
||||
@@ -1422,9 +1424,9 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
png_warning(png_ptr, "Unrecognized equation type for pCAL chunk");
|
||||
|
||||
purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1;
|
||||
png_debug1(3, "pCAL purpose length = %d\n", purpose_len);
|
||||
png_debug1(3, "pCAL purpose length = %d\n", (int)purpose_len);
|
||||
units_len = png_strlen(units) + (nparams == 0 ? 0 : 1);
|
||||
png_debug1(3, "pCAL units length = %d\n", units_len);
|
||||
png_debug1(3, "pCAL units length = %d\n", (int)units_len);
|
||||
total_len = purpose_len + units_len + 10;
|
||||
|
||||
params_len = (png_uint_32p)png_malloc(png_ptr, (png_uint_32)(nparams
|
||||
@@ -1439,7 +1441,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
total_len += (png_size_t)params_len[i];
|
||||
}
|
||||
|
||||
png_debug1(3, "pCAL total length = %d\n", total_len);
|
||||
png_debug1(3, "pCAL total length = %d\n", (int)total_len);
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_purpose, purpose_len);
|
||||
png_save_int_32(buf, X0);
|
||||
@@ -1491,7 +1493,7 @@ png_write_sCAL(png_structp png_ptr, int unit, double width,double height)
|
||||
#endif
|
||||
total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf);
|
||||
|
||||
png_debug1(3, "sCAL total length = %d\n", total_len);
|
||||
png_debug1(3, "sCAL total length = %d\n", (int)total_len);
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)&unit, 1);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1);
|
||||
|
||||
Reference in New Issue
Block a user