Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
cc93d89e
T
Third Party Libpng
项目概览
OpenHarmony
/
Third Party Libpng
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
cc93d89e
编写于
9月 30, 2013
作者:
J
John Bowler
提交者:
Glenn Randers-Pehrson
9月 30, 2013
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libpng16] Updated pngunknown.c
上级
8f381901
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
62 addition
and
45 deletion
+62
-45
contrib/libtests/pngunknown.c
contrib/libtests/pngunknown.c
+62
-45
未找到文件。
contrib/libtests/pngunknown.c
浏览文件 @
cc93d89e
...
...
@@ -87,6 +87,52 @@ typedef png_byte *png_const_bytep;
# define png_const_structp png_structp
#endif
#if PNG_LIBPNG_VER < 10700
/* Copied from libpng 1.7.0 png.h */
#define PNG_u2(b1, b2) (((unsigned int)(b1) << 8) + (b2))
#define PNG_U16(b1, b2) ((png_uint_16)PNG_u2(b1, b2))
#define PNG_U32(b1, b2, b3, b4)\
(((png_uint_32)PNG_u2(b1, b2) << 16) + PNG_u2(b3, b4))
/* Constants for known chunk types.
*/
#define png_IDAT PNG_U32( 73, 68, 65, 84)
#define png_IEND PNG_U32( 73, 69, 78, 68)
#define png_IHDR PNG_U32( 73, 72, 68, 82)
#define png_PLTE PNG_U32( 80, 76, 84, 69)
#define png_bKGD PNG_U32( 98, 75, 71, 68)
#define png_cHRM PNG_U32( 99, 72, 82, 77)
#define png_fRAc PNG_U32(102, 82, 65, 99)
/* registered, not defined */
#define png_gAMA PNG_U32(103, 65, 77, 65)
#define png_gIFg PNG_U32(103, 73, 70, 103)
#define png_gIFt PNG_U32(103, 73, 70, 116)
/* deprecated */
#define png_gIFx PNG_U32(103, 73, 70, 120)
#define png_hIST PNG_U32(104, 73, 83, 84)
#define png_iCCP PNG_U32(105, 67, 67, 80)
#define png_iTXt PNG_U32(105, 84, 88, 116)
#define png_oFFs PNG_U32(111, 70, 70, 115)
#define png_pCAL PNG_U32(112, 67, 65, 76)
#define png_pHYs PNG_U32(112, 72, 89, 115)
#define png_sBIT PNG_U32(115, 66, 73, 84)
#define png_sCAL PNG_U32(115, 67, 65, 76)
#define png_sPLT PNG_U32(115, 80, 76, 84)
#define png_sRGB PNG_U32(115, 82, 71, 66)
#define png_sTER PNG_U32(115, 84, 69, 82)
#define png_tEXt PNG_U32(116, 69, 88, 116)
#define png_tIME PNG_U32(116, 73, 77, 69)
#define png_tRNS PNG_U32(116, 82, 78, 83)
#define png_zTXt PNG_U32(122, 84, 88, 116)
/* Test on flag values as defined in the spec (section 5.4): */
#define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29))
#define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c))
#define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21))
#define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13))
#define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5))
#endif
/* PNG_LIBPNG_VER < 10700 */
#ifdef __cplusplus
# define this not_the_cpp_this
# define new not_the_cpp_new
...
...
@@ -106,41 +152,8 @@ typedef png_byte *png_const_bytep;
# endif
#endif
/* Copied from pngpriv.h */
#define PNG_32b(b,s) ((png_uint_32)(b) << (s))
#define PNG_CHUNK(b1,b2,b3,b4) \
(PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0))
#define png_IHDR PNG_CHUNK( 73, 72, 68, 82)
#define png_IDAT PNG_CHUNK( 73, 68, 65, 84)
#define png_IEND PNG_CHUNK( 73, 69, 78, 68)
#define png_PLTE PNG_CHUNK( 80, 76, 84, 69)
#define png_bKGD PNG_CHUNK( 98, 75, 71, 68)
#define png_cHRM PNG_CHUNK( 99, 72, 82, 77)
#define png_gAMA PNG_CHUNK(103, 65, 77, 65)
#define png_hIST PNG_CHUNK(104, 73, 83, 84)
#define png_iCCP PNG_CHUNK(105, 67, 67, 80)
#define png_iTXt PNG_CHUNK(105, 84, 88, 116)
#define png_oFFs PNG_CHUNK(111, 70, 70, 115)
#define png_pCAL PNG_CHUNK(112, 67, 65, 76)
#define png_sCAL PNG_CHUNK(115, 67, 65, 76)
#define png_pHYs PNG_CHUNK(112, 72, 89, 115)
#define png_sBIT PNG_CHUNK(115, 66, 73, 84)
#define png_sPLT PNG_CHUNK(115, 80, 76, 84)
#define png_sRGB PNG_CHUNK(115, 82, 71, 66)
#define png_sTER PNG_CHUNK(115, 84, 69, 82)
#define png_tEXt PNG_CHUNK(116, 69, 88, 116)
#define png_tIME PNG_CHUNK(116, 73, 77, 69)
#define png_tRNS PNG_CHUNK(116, 82, 78, 83)
#define png_zTXt PNG_CHUNK(122, 84, 88, 116)
#define png_vpAg PNG_CHUNK('v', 'p', 'A', 'g')
/* Test on flag values as defined in the spec (section 5.4): */
#define PNG_CHUNK_ANCILLARY(c ) (1 & ((c) >> 29))
#define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c))
#define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21))
#define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13))
#define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5))
/* Types of chunks not known to libpng */
#define png_vpAg PNG_U32(118, 112, 65, 103)
/* Chunk information */
#define PNG_INFO_tEXt 0x10000000U
...
...
@@ -347,14 +360,14 @@ find_by_flag(png_uint_32 flag)
static
int
ancillary
(
const
char
*
name
)
{
return
PNG_CHUNK_ANCILLARY
(
PNG_
CHUNK
(
name
[
0
],
name
[
1
],
name
[
2
],
name
[
3
]));
return
PNG_CHUNK_ANCILLARY
(
PNG_
U32
(
name
[
0
],
name
[
1
],
name
[
2
],
name
[
3
]));
}
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
static
int
ancillaryb
(
const
png_byte
*
name
)
{
return
PNG_CHUNK_ANCILLARY
(
PNG_
CHUNK
(
name
[
0
],
name
[
1
],
name
[
2
],
name
[
3
]));
return
PNG_CHUNK_ANCILLARY
(
PNG_
U32
(
name
[
0
],
name
[
1
],
name
[
2
],
name
[
3
]));
}
#endif
...
...
@@ -401,9 +414,6 @@ clean_display(display *d)
d
->
test
);
exit
(
1
);
}
/* Invalidate the test */
d
->
test
=
init
;
}
PNG_FUNCTION
(
void
,
display_exit
,
(
display
*
d
),
static
PNG_NORETURN
)
...
...
@@ -846,7 +856,7 @@ check_error(display *d, png_uint_32 flags, const char *message)
static
void
check_handling
(
display
*
d
,
int
def
,
png_uint_32
chunks
,
png_uint_32
known
,
png_uint_32
unknown
,
const
char
*
position
)
png_uint_32
unknown
,
const
char
*
position
,
int
set_callback
)
{
while
(
chunks
)
{
...
...
@@ -856,6 +866,13 @@ check_handling(display *d, int def, png_uint_32 chunks, png_uint_32 known,
const
char
*
type
;
const
char
*
errorx
=
NULL
;
# ifdef PNG_READ_USER_CHUNKS_SUPPORTED
const
char
*
callback
=
(
set_callback
?
",callback"
:
""
);
# else
# define callback ""
UNUSED
(
set_callback
)
# endif
if
(
chunk_info
[
i
].
unknown
)
{
if
(
keep
==
PNG_HANDLE_CHUNK_AS_DEFAULT
)
...
...
@@ -953,8 +970,8 @@ check_handling(display *d, int def, png_uint_32 chunks, png_uint_32 known,
if
(
errorx
!=
NULL
)
{
++
(
d
->
error_count
);
fprintf
(
stderr
,
"%s(%s
): %s %s %s: %s
\n
"
,
d
->
file
,
d
->
test
,
type
,
chunk_info
[
i
].
name
,
position
,
errorx
);
fprintf
(
stderr
,
"%s(%s
%s): %s %s %s: %s
\n
"
,
d
->
file
,
d
->
test
,
callback
,
type
,
chunk_info
[
i
].
name
,
position
,
errorx
);
}
chunks
&=
~
flag
;
...
...
@@ -1007,9 +1024,9 @@ perform_one_test(FILE *fp, int argc, const char **argv,
* it or not.
*/
check_handling
(
d
,
def
,
flags
[
0
][
0
]
|
flags
[
0
][
1
],
flags
[
1
][
0
],
flags
[
1
][
1
],
"before IDAT"
);
"before IDAT"
,
set_callback
);
check_handling
(
d
,
def
,
flags
[
0
][
2
]
|
flags
[
0
][
3
],
flags
[
1
][
2
],
flags
[
1
][
3
],
"after IDAT"
);
"after IDAT"
,
set_callback
);
}
static
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录