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
f6ef0205
Commit
f6ef0205
authored
Jul 11, 2023
by
Jeff Smith
Committed by
Alexandre Julliard
Jul 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Set GIF frame delay and loop count properties correctly.
These properties are expected to be present even if frame count is 1.
parent
ba564e2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
21 deletions
+29
-21
image.c
dlls/gdiplus/image.c
+16
-20
image.c
dlls/gdiplus/tests/image.c
+13
-1
No files found.
dlls/gdiplus/image.c
View file @
f6ef0205
...
...
@@ -3301,29 +3301,25 @@ static void gif_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UI
PropertyItem
*
transparent_idx
=
NULL
,
*
loop
=
NULL
,
*
palette
=
NULL
;
IWICBitmapDecoder_GetFrameCount
(
decoder
,
&
frame_count
);
if
(
frame_count
>
1
)
delay
=
heap_alloc_zero
(
sizeof
(
*
delay
)
+
frame_count
*
sizeof
(
LONG
));
if
(
delay
)
{
delay
=
heap_alloc_zero
(
sizeof
(
*
delay
)
+
frame_count
*
sizeof
(
LONG
));
if
(
delay
)
{
LONG
*
value
;
LONG
*
value
;
delay
->
type
=
PropertyTagTypeLong
;
delay
->
id
=
PropertyTagFrameDelay
;
delay
->
length
=
frame_count
*
sizeof
(
LONG
);
delay
->
value
=
delay
+
1
;
delay
->
type
=
PropertyTagTypeLong
;
delay
->
id
=
PropertyTagFrameDelay
;
delay
->
length
=
frame_count
*
sizeof
(
LONG
);
delay
->
value
=
delay
+
1
;
value
=
delay
->
value
;
value
=
delay
->
value
;
for
(
i
=
0
;
i
<
frame_count
;
i
++
)
for
(
i
=
0
;
i
<
frame_count
;
i
++
)
{
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
i
,
&
frame
);
if
(
hr
==
S_OK
)
{
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
i
,
&
frame
);
if
(
hr
==
S_OK
)
{
value
[
i
]
=
get_gif_frame_property
(
frame
,
&
GUID_MetadataFormatGCE
,
L"Delay"
);
IWICBitmapFrameDecode_Release
(
frame
);
}
else
value
[
i
]
=
0
;
value
[
i
]
=
get_gif_frame_property
(
frame
,
&
GUID_MetadataFormatGCE
,
L"Delay"
);
IWICBitmapFrameDecode_Release
(
frame
);
}
}
}
...
...
@@ -3342,7 +3338,7 @@ static void gif_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UI
if
(
!
comment
)
comment
=
get_gif_comment
(
reader
);
if
(
frame_count
>
1
&&
!
loop
)
if
(
!
loop
)
loop
=
get_gif_loopcount
(
reader
);
if
(
!
background
)
...
...
@@ -3358,7 +3354,7 @@ static void gif_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UI
IWICMetadataBlockReader_Release
(
block_reader
);
}
if
(
frame_count
>
1
&&
!
loop
)
if
(
!
loop
)
{
loop
=
heap_alloc_zero
(
sizeof
(
*
loop
)
+
sizeof
(
SHORT
));
if
(
loop
)
...
...
dlls/gdiplus/tests/image.c
View file @
f6ef0205
...
...
@@ -3726,7 +3726,7 @@ static void test_image_properties(void)
status
=
GdipGetPropertyCount
(
image
,
&
prop_count
);
ok
(
status
==
Ok
,
"GdipGetPropertyCount error %d
\n
"
,
status
);
todo_wine_if
(
td
[
i
].
image_data
==
pngimage
||
td
[
i
].
image_data
==
jpgimage
||
td
[
i
].
image_data
==
gifimage
)
todo_wine_if
(
td
[
i
].
image_data
==
pngimage
||
td
[
i
].
image_data
==
jpgimage
)
ok
(
td
[
i
].
prop_count
==
prop_count
||
(
td
[
i
].
prop_count2
!=
~
0
&&
td
[
i
].
prop_count2
==
prop_count
),
"expected property count %u or %u, got %u
\n
"
,
td
[
i
].
prop_count
,
td
[
i
].
prop_count2
,
prop_count
);
...
...
@@ -4859,6 +4859,12 @@ static const BYTE gif_2frame_no_pal[] = {
0x02
,
0x02
,
0x44
,
0x01
,
0x00
,
0x3b
};
static
const
BYTE
gif_no_pal
[]
=
{
'G'
,
'I'
,
'F'
,
'8'
,
'7'
,
'a'
,
0x01
,
0x00
,
0x01
,
0x00
,
0x27
,
0x02
,
0x00
,
0x2c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x01
,
0x00
,
0x01
,
0x02
,
0x02
,
0x44
,
0x01
,
0x00
,
0x3b
};
static
void
test_gif_properties
(
void
)
{
static
const
struct
property_test_data
animatedgif_props
[]
=
...
...
@@ -4882,6 +4888,11 @@ static void test_gif_properties(void)
{
PropertyTagTypeLong
,
PropertyTagFrameDelay
,
8
,
{
10
,
0
,
0
,
0
,
20
,
0
,
0
,
0
}
},
{
PropertyTagTypeShort
,
PropertyTagLoopCount
,
2
,
{
1
,
0
}
},
};
static
const
struct
property_test_data
gif_no_pal_props
[]
=
{
{
PropertyTagTypeLong
,
PropertyTagFrameDelay
,
4
,
{
0
,
0
,
0
,
0
}
},
{
PropertyTagTypeShort
,
PropertyTagLoopCount
,
2
,
{
1
,
0
}
},
};
static
const
struct
test_data
{
const
BYTE
*
image_data
;
...
...
@@ -4895,6 +4906,7 @@ static void test_gif_properties(void)
giftest
(
animatedgif
,
animatedgif_props
,
2
),
giftest
(
gif_2frame_global_pal
,
gif_2frame_global_pal_props
,
2
),
giftest
(
gif_2frame_no_pal
,
gif_2frame_no_pal_props
,
2
),
giftest
(
gif_no_pal
,
gif_no_pal_props
,
1
),
#undef giftest
};
...
...
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