Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
31f92b0f
T
Third Party Libpng
项目概览
OpenHarmony
/
Third Party Libpng
12 个月 前同步成功
通知
4
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Libpng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
31f92b0f
编写于
3月 09, 2010
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[devel] Eliminated dependence of pngtest.c on the private pngdebug.h file.
上级
f70645c5
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
40 addition
and
28 deletion
+40
-28
ANNOUNCE
ANNOUNCE
+1
-0
CHANGES
CHANGES
+3
-0
pngtest.c
pngtest.c
+36
-28
未找到文件。
ANNOUNCE
浏览文件 @
31f92b0f
...
...
@@ -92,6 +92,7 @@ version 1.5.0beta13 [March 9, 2010]
Removed unused png_measure_compressed_chunk() from pngpriv.h and libpngpf.3
Moved the 'config.h' support from pngconf.h to pngpriv.h
Removed PNGAPI from the png_longjmp_ptr typedef.
Eliminated dependence of pngtest.c on the private pngdebug.h file.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
...
...
CHANGES
浏览文件 @
31f92b0f
...
...
@@ -2567,6 +2567,9 @@ version 1.5.0beta13 [March 9, 2010]
PNG_USER_CHUNK_MALLOC_MAX nor PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
is defined.
Removed unused png_measure_compressed_chunk() from pngpriv.h and libpngpf.3
Moved the 'config.h' support from pngconf.h to pngpriv.h
Removed PNGAPI from the png_longjmp_ptr typedef.
Eliminated dependence of pngtest.c on the private pngdebug.h file.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
...
...
pngtest.c
浏览文件 @
31f92b0f
...
...
@@ -46,7 +46,15 @@
# define PNG_DEBUG 0
#endif
#include "pngdebug.h"
#if PNG_DEBUG > 1
# define pngtest_debug(m) ((void)fprintf(stderr, m "\n"))
# define pngtest_debug1(m,p1) ((void)fprintf(stderr, m "\n", p1))
# define pngtest_debug2(m,p1,p2) ((void)fprintf(stderr, m "\n", p1, p2))
#else
# define pngtest_debug(m) ((void)0)
# define pngtest_debug1(m,p1) ((void)0)
# define pngtest_debug2(m,p1,p2) ((void)0)
#endif
#if !PNG_DEBUG
# define SINGLE_ROWBUF_ALLOC
/* Makes buffer overruns easier to nail */
...
...
@@ -508,7 +516,7 @@ png_debug_malloc(png_structp png_ptr, png_alloc_size_t size)
/* Make sure the caller isn't assuming zeroed memory. */
png_memset
(
pinfo
->
pointer
,
0xdd
,
pinfo
->
size
);
if
(
verbose
)
printf
(
"png_malloc %lu bytes at %
x
\n
"
,
(
unsigned
long
)
size
,
printf
(
"png_malloc %lu bytes at %
p
\n
"
,
(
unsigned
long
)
size
,
pinfo
->
pointer
);
return
(
png_voidp
)(
pinfo
->
pointer
);
}
...
...
@@ -558,7 +566,7 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
/* Finally free the data. */
if
(
verbose
)
printf
(
"Freeing %
x
\n
"
,
ptr
);
printf
(
"Freeing %
p
\n
"
,
ptr
);
png_free_default
(
png_ptr
,
ptr
);
ptr
=
NULL
;
}
...
...
@@ -678,7 +686,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
return
(
1
);
}
png
_debug
(
0
,
"Allocating read and write structures"
);
png
test_debug
(
"Allocating read and write structures"
);
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
read_ptr
=
png_create_read_struct_2
(
PNG_LIBPNG_VER_STRING
,
NULL
,
...
...
@@ -716,7 +724,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
pngtest_warning
);
#endif
#endif
png
_debug
(
0
,
"Allocating read_info, write_info and end_info structures"
);
png
test_debug
(
"Allocating read_info, write_info and end_info structures"
);
read_info_ptr
=
png_create_info_struct
(
read_ptr
);
end_info_ptr
=
png_create_info_struct
(
read_ptr
);
#ifdef PNG_WRITE_SUPPORTED
...
...
@@ -725,7 +733,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#ifdef PNG_SETJMP_SUPPORTED
png
_debug
(
0
,
"Setting jmpbuf for read struct"
);
png
test_debug
(
"Setting jmpbuf for read struct"
);
#ifdef USE_FAR_KEYWORD
if
(
setjmp
(
png_jmpbuf
))
#else
...
...
@@ -749,7 +757,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#ifdef PNG_WRITE_SUPPORTED
png
_debug
(
0
,
"Setting jmpbuf for write struct"
);
png
test_debug
(
"Setting jmpbuf for write struct"
);
#ifdef USE_FAR_KEYWORD
if
(
setjmp
(
png_jmpbuf
))
#else
...
...
@@ -772,7 +780,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#endif
png
_debug
(
0
,
"Initializing input and output streams"
);
png
test_debug
(
"Initializing input and output streams"
);
#ifdef PNG_STDIO_SUPPORTED
png_init_io
(
read_ptr
,
fpin
);
# ifdef PNG_WRITE_SUPPORTED
...
...
@@ -832,10 +840,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
NULL
,
0
);
#endif
png
_debug
(
0
,
"Reading info struct"
);
png
test_debug
(
"Reading info struct"
);
png_read_info
(
read_ptr
,
read_info_ptr
);
png
_debug
(
0
,
"Transferring info struct"
);
png
test_debug
(
"Transferring info struct"
);
{
int
interlace_type
,
compression_type
,
filter_type
;
...
...
@@ -1022,7 +1030,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
if
(
png_get_text
(
read_ptr
,
read_info_ptr
,
&
text_ptr
,
&
num_text
)
>
0
)
{
png
_debug1
(
0
,
"Handling %d iTXt/tEXt/zTXt chunks"
,
num_text
);
png
test_debug1
(
"Handling %d iTXt/tEXt/zTXt chunks"
,
num_text
);
png_set_text
(
write_ptr
,
write_info_ptr
,
text_ptr
,
num_text
);
}
}
...
...
@@ -1092,7 +1100,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#ifdef PNG_WRITE_SUPPORTED
png
_debug
(
0
,
"Writing info struct"
);
png
test_debug
(
"Writing info struct"
);
/* If we wanted, we could write info in two steps:
* png_write_info_before_PLTE(write_ptr, write_info_ptr);
...
...
@@ -1135,12 +1143,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#ifdef SINGLE_ROWBUF_ALLOC
png
_debug
(
0
,
"Allocating row buffer..."
);
png
test_debug
(
"Allocating row buffer..."
);
row_buf
=
(
png_bytep
)
png_malloc
(
read_ptr
,
png_get_rowbytes
(
read_ptr
,
read_info_ptr
));
png
_debug1
(
0
,
"
0x%08lx"
,
(
unsigned
long
)
row_buf
);
png
test_debug1
(
"
\t
0x%08lx"
,
(
unsigned
long
)
row_buf
);
#endif
/* SINGLE_ROWBUF_ALLOC */
png
_debug
(
0
,
"Writing row data"
);
png
test_debug
(
"Writing row data"
);
#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
defined(PNG_WRITE_INTERLACING_SUPPORTED)
...
...
@@ -1159,14 +1167,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
for
(
pass
=
0
;
pass
<
num_pass
;
pass
++
)
{
png
_debug1
(
0
,
"Writing row data for pass %d"
,
pass
);
png
test_debug1
(
"Writing row data for pass %d"
,
pass
);
for
(
y
=
0
;
y
<
height
;
y
++
)
{
#ifndef SINGLE_ROWBUF_ALLOC
png
_debug2
(
0
,
"Allocating row buffer (pass %d, y = %ld
)..."
,
pass
,
y
);
png
test_debug2
(
"Allocating row buffer (pass %d, y = %u
)..."
,
pass
,
y
);
row_buf
=
(
png_bytep
)
png_malloc
(
read_ptr
,
png_get_rowbytes
(
read_ptr
,
read_info_ptr
));
png
_debug2
(
0
,
"0x%08lx (%ld
bytes)"
,
(
unsigned
long
)
row_buf
,
png
test_debug2
(
"
\t
0x%08lx (%u
bytes)"
,
(
unsigned
long
)
row_buf
,
png_get_rowbytes
(
read_ptr
,
read_info_ptr
));
#endif
/* !SINGLE_ROWBUF_ALLOC */
png_read_rows
(
read_ptr
,
(
png_bytepp
)
&
row_buf
,
NULL
,
1
);
...
...
@@ -1186,7 +1194,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
/* PNG_WRITE_SUPPORTED */
#ifndef SINGLE_ROWBUF_ALLOC
png
_debug2
(
0
,
"Freeing row buffer (pass %d, y = %ld
)"
,
pass
,
y
);
png
test_debug2
(
"Freeing row buffer (pass %d, y = %u
)"
,
pass
,
y
);
png_free
(
read_ptr
,
row_buf
);
row_buf
=
NULL
;
#endif
/* !SINGLE_ROWBUF_ALLOC */
...
...
@@ -1200,7 +1208,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_free_data
(
write_ptr
,
write_info_ptr
,
PNG_FREE_UNKN
,
-
1
);
#endif
png
_debug
(
0
,
"Reading and writing end_info data"
);
png
test_debug
(
"Reading and writing end_info data"
);
png_read_end
(
read_ptr
,
end_info_ptr
);
#ifdef PNG_TEXT_SUPPORTED
...
...
@@ -1210,7 +1218,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
if
(
png_get_text
(
read_ptr
,
end_info_ptr
,
&
text_ptr
,
&
num_text
)
>
0
)
{
png
_debug1
(
0
,
"Handling %d iTXt/tEXt/zTXt chunks"
,
num_text
);
png
test_debug1
(
"Handling %d iTXt/tEXt/zTXt chunks"
,
num_text
);
png_set_text
(
write_ptr
,
write_end_info_ptr
,
text_ptr
,
num_text
);
}
}
...
...
@@ -1271,26 +1279,26 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
}
#endif
png
_debug
(
0
,
"Destroying data structs"
);
png
test_debug
(
"Destroying data structs"
);
#ifdef SINGLE_ROWBUF_ALLOC
png
_debug
(
1
,
"destroying row_buf for read_ptr"
);
png
test_debug
(
"destroying row_buf for read_ptr"
);
png_free
(
read_ptr
,
row_buf
);
row_buf
=
NULL
;
#endif
/* SINGLE_ROWBUF_ALLOC */
png
_debug
(
1
,
"destroying read_ptr, read_info_ptr, end_info_ptr"
);
png
test_debug
(
"destroying read_ptr, read_info_ptr, end_info_ptr"
);
png_destroy_read_struct
(
&
read_ptr
,
&
read_info_ptr
,
&
end_info_ptr
);
#ifdef PNG_WRITE_SUPPORTED
png
_debug
(
1
,
"destroying write_end_info_ptr"
);
png
test_debug
(
"destroying write_end_info_ptr"
);
png_destroy_info_struct
(
write_ptr
,
&
write_end_info_ptr
);
png
_debug
(
1
,
"destroying write_ptr, write_info_ptr"
);
png
test_debug
(
"destroying write_ptr, write_info_ptr"
);
png_destroy_write_struct
(
&
write_ptr
,
&
write_info_ptr
);
#endif
png
_debug
(
0
,
"Destruction complete."
);
png
test_debug
(
"Destruction complete."
);
FCLOSE
(
fpin
);
FCLOSE
(
fpout
);
png
_debug
(
0
,
"Opening files for comparison"
);
png
test_debug
(
"Opening files for comparison"
);
if
((
fpin
=
fopen
(
inname
,
"rb"
))
==
NULL
)
{
fprintf
(
STDERR
,
"Could not find file %s
\n
"
,
inname
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录