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
12586f76
Commit
12586f76
authored
Aug 14, 2013
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Always provide image data in the format requested by image encoders.
parent
85b989c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
image.c
dlls/gdiplus/image.c
+23
-2
No files found.
dlls/gdiplus/image.c
View file @
12586f76
...
...
@@ -4002,6 +4002,7 @@ static GpStatus encode_image_WIC(GpImage *image, IStream* stream,
HRESULT
hr
;
UINT
width
,
height
;
PixelFormat
gdipformat
=
0
;
const
WICPixelFormatGUID
*
desired_wicformat
;
WICPixelFormatGUID
wicformat
;
GpRect
rc
;
BitmapData
lockeddata
;
...
...
@@ -4054,20 +4055,40 @@ static GpStatus encode_image_WIC(GpImage *image, IStream* stream,
{
if
(
pixel_formats
[
i
].
gdip_format
==
bitmap
->
format
)
{
memcpy
(
&
wicformat
,
pixel_formats
[
i
].
wic_format
,
sizeof
(
GUID
))
;
desired_wicformat
=
pixel_formats
[
i
].
wic_format
;
gdipformat
=
bitmap
->
format
;
break
;
}
}
if
(
!
gdipformat
)
{
memcpy
(
&
wicformat
,
&
GUID_WICPixelFormat32bppBGRA
,
sizeof
(
GUID
))
;
desired_wicformat
=
&
GUID_WICPixelFormat32bppBGRA
;
gdipformat
=
PixelFormat32bppARGB
;
}
memcpy
(
&
wicformat
,
desired_wicformat
,
sizeof
(
GUID
));
hr
=
IWICBitmapFrameEncode_SetPixelFormat
(
frameencode
,
&
wicformat
);
}
if
(
SUCCEEDED
(
hr
)
&&
!
IsEqualGUID
(
desired_wicformat
,
&
wicformat
))
{
/* Encoder doesn't support this bitmap's format. */
gdipformat
=
0
;
for
(
i
=
0
;
pixel_formats
[
i
].
wic_format
;
i
++
)
{
if
(
IsEqualGUID
(
&
wicformat
,
pixel_formats
[
i
].
wic_format
))
{
gdipformat
=
bitmap
->
format
;
break
;
}
}
if
(
!
gdipformat
)
{
ERR
(
"Cannot support encoder format %s
\n
"
,
debugstr_guid
(
&
wicformat
));
hr
=
E_FAIL
;
}
}
if
(
SUCCEEDED
(
hr
))
{
stat
=
GdipBitmapLockBits
(
bitmap
,
&
rc
,
ImageLockModeRead
,
gdipformat
,
...
...
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