Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f2f5cd83
Commit
f2f5cd83
authored
Mar 25, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 31, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement PngDecoder_Block_GetReaderByIndex.
parent
43c97b87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
5 deletions
+48
-5
pngformat.c
dlls/windowscodecs/pngformat.c
+45
-2
metadata.c
dlls/windowscodecs/tests/metadata.c
+3
-3
No files found.
dlls/windowscodecs/pngformat.c
View file @
f2f5cd83
...
...
@@ -1062,8 +1062,51 @@ static HRESULT WINAPI PngDecoder_Block_GetCount(IWICMetadataBlockReader *iface,
static
HRESULT
WINAPI
PngDecoder_Block_GetReaderByIndex
(
IWICMetadataBlockReader
*
iface
,
UINT
nIndex
,
IWICMetadataReader
**
ppIMetadataReader
)
{
FIXME
(
"%p,%d,%p
\n
"
,
iface
,
nIndex
,
ppIMetadataReader
);
return
E_NOTIMPL
;
PngDecoder
*
This
=
impl_from_IWICMetadataBlockReader
(
iface
);
HRESULT
hr
;
IWICComponentFactory
*
factory
;
IWICStream
*
stream
;
TRACE
(
"%p,%d,%p
\n
"
,
iface
,
nIndex
,
ppIMetadataReader
);
if
(
nIndex
>=
This
->
metadata_count
||
!
ppIMetadataReader
)
return
E_INVALIDARG
;
if
(
!
This
->
metadata_blocks
[
nIndex
].
reader
)
{
hr
=
StreamImpl_Create
(
&
stream
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICStream_InitializeFromIStreamRegion
(
stream
,
This
->
stream
,
This
->
metadata_blocks
[
nIndex
].
ofs
,
This
->
metadata_blocks
[
nIndex
].
len
);
if
(
SUCCEEDED
(
hr
))
hr
=
ComponentFactory_CreateInstance
(
&
IID_IWICComponentFactory
,
(
void
**
)
&
factory
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICComponentFactory_CreateMetadataReaderFromContainer
(
factory
,
&
GUID_ContainerFormatPng
,
NULL
,
WICMetadataCreationAllowUnknown
,
(
IStream
*
)
stream
,
&
This
->
metadata_blocks
[
nIndex
].
reader
);
IWICComponentFactory_Release
(
factory
);
}
IWICStream_Release
(
stream
);
}
if
(
FAILED
(
hr
))
{
*
ppIMetadataReader
=
NULL
;
return
hr
;
}
}
*
ppIMetadataReader
=
This
->
metadata_blocks
[
nIndex
].
reader
;
IWICMetadataReader_AddRef
(
*
ppIMetadataReader
);
return
S_OK
;
}
static
HRESULT
WINAPI
PngDecoder_Block_GetEnumerator
(
IWICMetadataBlockReader
*
iface
,
...
...
dlls/windowscodecs/tests/metadata.c
View file @
f2f5cd83
...
...
@@ -960,19 +960,19 @@ static void test_metadata_png(void)
}
hr
=
IWICMetadataBlockReader_GetReaderByIndex
(
blockreader
,
0
,
&
reader
);
todo_wine
ok
(
hr
==
S_OK
,
"GetReaderByIndex failed, hr=%x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetReaderByIndex failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
&
containerformat
);
ok
(
hr
==
S_OK
,
"GetMetadataFormat failed, hr=%#x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
containerformat
,
&
GUID_MetadataFormatChunktIME
)
||
todo_wine
ok
(
IsEqualGUID
(
&
containerformat
,
&
GUID_MetadataFormatChunktIME
)
||
broken
(
IsEqualGUID
(
&
containerformat
,
&
GUID_MetadataFormatUnknown
))
/* Windows XP */
,
"unexpected container format
\n
"
);
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
ok
(
hr
==
S_OK
,
"GetCount error %#x
\n
"
,
hr
);
ok
(
count
==
6
||
broken
(
count
==
1
)
/* XP */
,
"expected 6, got %u
\n
"
,
count
);
todo_wine
ok
(
count
==
6
||
broken
(
count
==
1
)
/* XP */
,
"expected 6, got %u
\n
"
,
count
);
if
(
count
==
6
)
compare_metadata
(
reader
,
td
,
count
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment