Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8d72c277
Commit
8d72c277
authored
Jan 09, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: BMP decoder should always return valid image resolution.
parent
01ab797b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
bmpdecode.c
dlls/windowscodecs/bmpdecode.c
+21
-8
bmpformat.c
dlls/windowscodecs/tests/bmpformat.c
+0
-2
No files found.
dlls/windowscodecs/bmpdecode.c
View file @
8d72c277
...
...
@@ -163,22 +163,35 @@ static HRESULT WINAPI BmpFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface
static
HRESULT
BmpHeader_GetResolution
(
BITMAPV5HEADER
*
bih
,
double
*
pDpiX
,
double
*
pDpiY
)
{
LONG
resx
=
0
,
resy
=
0
;
switch
(
bih
->
bV5Size
)
{
default:
case
sizeof
(
BITMAPCOREHEADER
):
*
pDpiX
=
96
.
0
;
*
pDpiY
=
96
.
0
;
return
S_OK
;
break
;
case
sizeof
(
BITMAPCOREHEADER2
):
case
sizeof
(
BITMAPINFOHEADER
):
case
sizeof
(
BITMAPV4HEADER
):
case
sizeof
(
BITMAPV5HEADER
):
*
pDpiX
=
bih
->
bV5XPelsPerMeter
*
0
.
0254
;
*
pDpiY
=
bih
->
bV5YPelsPerMeter
*
0
.
0254
;
return
S_OK
;
default:
return
E_FAIL
;
resx
=
bih
->
bV5XPelsPerMeter
;
resy
=
bih
->
bV5YPelsPerMeter
;
break
;
}
if
(
!
resx
||
!
resy
)
{
*
pDpiX
=
96
.
0
;
*
pDpiY
=
96
.
0
;
}
else
{
*
pDpiX
=
resx
*
0
.
0254
;
*
pDpiY
=
resy
*
0
.
0254
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
BmpFrameDecode_GetResolution
(
IWICBitmapFrameDecode
*
iface
,
...
...
dlls/windowscodecs/tests/bmpformat.c
View file @
8d72c277
...
...
@@ -138,9 +138,7 @@ static void test_decode_24bpp(void)
hr
=
IWICBitmapFrameDecode_GetResolution
(
framedecode
,
&
dpiX
,
&
dpiY
);
ok
(
SUCCEEDED
(
hr
),
"GetResolution failed, hr=%x
\n
"
,
hr
);
todo_wine
ok
(
dpiX
==
96
.
0
,
"expected dpiX=96.0, got %f
\n
"
,
dpiX
);
todo_wine
ok
(
dpiY
==
96
.
0
,
"expected dpiY=96.0, got %f
\n
"
,
dpiY
);
hr
=
IWICBitmapFrameDecode_GetPixelFormat
(
framedecode
,
&
guidresult
);
...
...
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