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
333a63c4
Commit
333a63c4
authored
Mar 03, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Use transparency instead of background color if transparent color flag is set in GIF GCE.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54563
parent
93941d6e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
13 deletions
+66
-13
image.c
dlls/gdiplus/image.c
+2
-12
image.c
dlls/gdiplus/tests/image.c
+64
-1
No files found.
dlls/gdiplus/image.c
View file @
333a63c4
...
...
@@ -3881,21 +3881,11 @@ static DWORD get_gif_background_color(GpBitmap *bitmap)
UINT
i
;
for
(
i
=
0
;
i
<
bitmap
->
prop_count
;
i
++
)
{
if
(
bitmap
->
prop_item
[
i
].
id
==
PropertyTagIndexBackground
)
{
if
(
bitmap
->
prop_item
[
i
].
id
==
PropertyTagIndexBackground
)
bgcolor_idx
=
*
(
BYTE
*
)
bitmap
->
prop_item
[
i
].
value
;
break
;
}
}
for
(
i
=
0
;
i
<
bitmap
->
prop_count
;
i
++
)
{
if
(
bitmap
->
prop_item
[
i
].
id
==
PropertyTagIndexTransparent
)
{
BYTE
transparent_idx
;
transparent_idx
=
*
(
BYTE
*
)
bitmap
->
prop_item
[
i
].
value
;
if
(
transparent_idx
==
bgcolor_idx
)
else
if
(
bitmap
->
prop_item
[
i
].
id
==
PropertyTagIndexTransparent
)
return
0
;
}
}
for
(
i
=
0
;
i
<
bitmap
->
prop_count
;
i
++
)
{
if
(
bitmap
->
prop_item
[
i
].
id
==
PropertyTagGlobalPalette
)
{
...
...
dlls/gdiplus/tests/image.c
View file @
333a63c4
...
...
@@ -2899,10 +2899,11 @@ static const unsigned char gifanimation[72] = {
* -dispose previous -page +4+0 -size 2x2 xc:green \
* -dispose undefined -page +6+0 -size 2x2 xc:gray \
* test.gif
* Background color index changed to 1.
*/
static
const
unsigned
char
gifanimation2
[]
=
{
0x47
,
0x49
,
0x46
,
0x38
,
0x39
,
0x61
,
0x08
,
0x00
,
0x02
,
0x00
,
0xf0
,
0x0
0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0xf0
,
0x0
1
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x01
,
0x64
,
0x00
,
0x00
,
0x00
,
0x21
,
0xff
,
0x0b
,
0x4e
,
0x45
,
0x54
,
0x53
,
0x43
,
0x41
,
0x50
,
0x45
,
0x32
,
0x2e
,
...
...
@@ -2937,6 +2938,43 @@ static ARGB gifanimation2_pixels[5][4] = {
{
0xffff0000
,
0
,
0
,
0xff7e7e7e
}
};
static
const
unsigned
char
gifanimation3
[]
=
{
0x47
,
0x49
,
0x46
,
0x38
,
0x39
,
0x61
,
0x08
,
0x00
,
0x02
,
0x00
,
0xf0
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x00
,
0x64
,
0x00
,
0x00
,
0x00
,
0x21
,
0xff
,
0x0b
,
0x4e
,
0x45
,
0x54
,
0x53
,
0x43
,
0x41
,
0x50
,
0x45
,
0x32
,
0x2e
,
0x30
,
0x03
,
0x01
,
0x00
,
0x00
,
0x00
,
0x2c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x02
,
0x00
,
0x00
,
0x02
,
0x04
,
0x84
,
0x8f
,
0x09
,
0x05
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x05
,
0x64
,
0x00
,
0x10
,
0x00
,
0x2c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x02
,
0x00
,
0x81
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0x02
,
0x03
,
0x44
,
0x34
,
0x05
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x09
,
0x64
,
0x00
,
0x10
,
0x00
,
0x2c
,
0x02
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x02
,
0x00
,
0x81
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x02
,
0x03
,
0x44
,
0x34
,
0x05
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x0d
,
0x64
,
0x00
,
0x10
,
0x00
,
0x2c
,
0x04
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x02
,
0x00
,
0x81
,
0x00
,
0x80
,
0x00
,
0x00
,
0x80
,
0x00
,
0x00
,
0x80
,
0x00
,
0x00
,
0x80
,
0x00
,
0x02
,
0x03
,
0x44
,
0x34
,
0x05
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x01
,
0x64
,
0x00
,
0x10
,
0x00
,
0x2c
,
0x06
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x02
,
0x00
,
0x80
,
0x7e
,
0x7e
,
0x7e
,
0x00
,
0x00
,
0x00
,
0x02
,
0x02
,
0x84
,
0x51
,
0x00
,
0x3b
};
static
ARGB
gifanimation3_pixels
[
5
][
4
]
=
{
{
0xff000000
,
0xff000000
,
0xff000000
,
0xff000000
},
{
0xffff0000
,
0xff000000
,
0xff000000
,
0xff000000
},
{
0xffff0000
,
0xff0000ff
,
0xff000000
,
0xff000000
},
{
0xffff0000
,
0xff000000
,
0xff008000
,
0xff000000
},
{
0xffff0000
,
0xff000000
,
0xff000000
,
0xff7e7e7e
}
};
static
void
test_multiframegif
(
void
)
{
LPSTREAM
stream
;
...
...
@@ -3185,6 +3223,31 @@ static void test_multiframegif(void)
}
GdipDisposeImage
((
GpImage
*
)
bmp
);
hglob
=
GlobalAlloc
(
0
,
sizeof
(
gifanimation3
));
data
=
GlobalLock
(
hglob
);
memcpy
(
data
,
gifanimation3
,
sizeof
(
gifanimation3
));
GlobalUnlock
(
hglob
);
hres
=
CreateStreamOnHGlobal
(
hglob
,
TRUE
,
&
stream
);
ok
(
hres
==
S_OK
,
"Failed to create a stream
\n
"
);
stat
=
GdipCreateBitmapFromStream
(
stream
,
&
bmp
);
ok
(
stat
==
Ok
,
"Failed to create a Bitmap
\n
"
);
IStream_Release
(
stream
);
for
(
i
=
0
;
i
<
6
;
i
++
)
{
stat
=
GdipImageSelectActiveFrame
((
GpImage
*
)
bmp
,
&
dimension
,
i
%
5
);
expect
(
Ok
,
stat
);
for
(
j
=
0
;
j
<
4
;
j
++
)
{
stat
=
GdipBitmapGetPixel
(
bmp
,
j
*
2
,
0
,
&
color
);
expect
(
Ok
,
stat
);
ok
(
gifanimation3_pixels
[
i
%
5
][
j
]
==
color
,
"at %d,%d got %lx, expected %lx
\n
"
,
i
,
j
,
color
,
gifanimation3_pixels
[
i
%
5
][
j
]);
}
}
GdipDisposeImage
((
GpImage
*
)
bmp
);
}
static
void
test_rotateflip
(
void
)
...
...
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