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
4c7f6f68
Commit
4c7f6f68
authored
Jun 21, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add support for loading of multiple 8-byte IFD fields.
parent
4d974f07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
metadatahandler.c
dlls/windowscodecs/metadatahandler.c
+31
-1
metadata.c
dlls/windowscodecs/tests/metadata.c
+9
-2
No files found.
dlls/windowscodecs/metadatahandler.c
View file @
4c7f6f68
...
...
@@ -865,7 +865,37 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry,
}
break
;
}
FIXME
(
"loading multiple rational fields is not implemented
\n
"
);
else
{
item
->
value
.
vt
|=
VT_VECTOR
;
item
->
value
.
u
.
cauh
.
cElems
=
count
;
item
->
value
.
u
.
cauh
.
pElems
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
8
);
if
(
!
item
->
value
.
u
.
cauh
.
pElems
)
return
E_OUTOFMEMORY
;
pos
.
QuadPart
=
value
;
hr
=
IStream_Seek
(
input
,
pos
,
SEEK_SET
,
NULL
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
item
->
value
.
u
.
cauh
.
pElems
);
return
hr
;
}
hr
=
IStream_Read
(
input
,
item
->
value
.
u
.
cauh
.
pElems
,
count
*
8
,
NULL
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
item
->
value
.
u
.
cauh
.
pElems
);
return
hr
;
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
type
==
IFD_DOUBLE
)
SWAP_ULONGLONG
(
item
->
value
.
u
.
cauh
.
pElems
[
i
].
QuadPart
);
else
{
SWAP_ULONG
(
item
->
value
.
u
.
cauh
.
pElems
[
i
].
u
.
LowPart
);
SWAP_ULONG
(
item
->
value
.
u
.
cauh
.
pElems
[
i
].
u
.
HighPart
);
}
}
}
break
;
case
IFD_ASCII
:
item
->
value
.
u
.
pszVal
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
+
1
);
...
...
dlls/windowscodecs/tests/metadata.c
View file @
4c7f6f68
...
...
@@ -81,9 +81,10 @@ static const struct ifd_data
SHORT
short_val
[
4
];
LONG
long_val
[
2
];
FLOAT
float_val
[
2
];
struct
IFD_rational
rational
[
3
];
}
IFD_data
=
{
2
7
,
2
8
,
{
{
0xfe
,
IFD_SHORT
,
1
,
1
},
/* NEWSUBFILETYPE */
{
0x100
,
IFD_LONG
,
1
,
222
},
/* IMAGEWIDTH */
...
...
@@ -112,6 +113,7 @@ static const struct ifd_data
{
0xf013
,
IFD_SHORT
,
0
,
0x11223344
},
{
0xf014
,
IFD_LONG
,
0
,
0x11223344
},
{
0xf015
,
IFD_FLOAT
,
0
,
0x11223344
},
{
0xf016
,
IFD_SRATIONAL
,
3
,
FIELD_OFFSET
(
struct
ifd_data
,
rational
)
},
},
0
,
{
900
,
3
},
...
...
@@ -121,6 +123,7 @@ static const struct ifd_data
{
0x0101
,
0x0202
,
0x0303
,
0x0404
},
{
0x11223344
,
0x55667788
},
{
(
FLOAT
)
1234
.
5678
,
(
FLOAT
)
8765
.
4321
},
{
{
0x01020304
,
0x05060708
},
{
0x10203040
,
0x50607080
},
{
0x11223344
,
0x55667788
}
},
};
#include "poppack.h"
...
...
@@ -603,7 +606,7 @@ static void compare_ifd_metadata(IWICMetadataReader *reader, const struct test_d
static
void
test_metadata_IFD
(
void
)
{
static
const
struct
test_data
td
[
2
7
]
=
static
const
struct
test_data
td
[
2
8
]
=
{
{
VT_UI2
,
0xfe
,
0
,
{
1
}
},
{
VT_UI4
,
0x100
,
0
,
{
222
}
},
...
...
@@ -632,6 +635,10 @@ static void test_metadata_IFD(void)
{
VT_UI2
,
0xf013
,
0
,
{
0x3344
}
},
{
VT_UI4
,
0xf014
,
0
,
{
0x11223344
}
},
{
VT_R4
,
0xf015
,
0
,
{
0x11223344
}
},
{
VT_I8
|
VT_VECTOR
,
0xf016
,
3
,
{
((
LONGLONG
)
0x05060708
<<
32
)
|
0x01020304
,
((
LONGLONG
)
0x50607080
<<
32
)
|
0x10203040
,
((
LONGLONG
)
0x55667788
<<
32
)
|
0x11223344
}
},
};
HRESULT
hr
;
IWICMetadataReader
*
reader
;
...
...
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