Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,150
Issues
1,150
List
Boards
Labels
Service Desk
Milestones
Merge Requests
143
Merge Requests
143
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gtk
Commits
817ad6d3
Commit
817ad6d3
authored
Oct 20, 2002
by
Matthias Clasen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support the Netscape application extension for gif animations (#95060):
parent
6a82d4c6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
8 deletions
+62
-8
gdk-pixbuf/ChangeLog
gdk-pixbuf/ChangeLog
+13
-0
gdk-pixbuf/io-gif-animation.c
gdk-pixbuf/io-gif-animation.c
+9
-3
gdk-pixbuf/io-gif-animation.h
gdk-pixbuf/io-gif-animation.h
+2
-0
gdk-pixbuf/io-gif.c
gdk-pixbuf/io-gif.c
+38
-5
No files found.
gdk-pixbuf/ChangeLog
View file @
817ad6d3
2002
-
10
-
21
Matthias
Clasen
<
maclas
@
gmx
.
de
>
Support
the
Netscape
application
extension
for
gif
animations
(#
95060
):
*
io
-
gif
-
animation
.
h
:
*
io
-
gif
-
animation
.
c
(
gdk_pixbuf_gif_anim_iter_advance
):
Add
loop
count
to
GdkPixbufGifAnim
and
use
it
in
the
advance
method
of
GdkPixbufGifAnimIter
.
*
io
-
gif
.
c
(
gif_get_extension
):
Parse
Netscape
application
extension
block
and
set
the
animation
loop
count
.
2002
-
10
-
11
Matthias
Clasen
<
maclas
@
gmx
.
de
>
*
gdk
-
pixbuf
-
loader
.
c
(
gdk_pixbuf_loader_get_format
):
Remove
...
...
gdk-pixbuf/io-gif-animation.c
View file @
817ad6d3
...
...
@@ -260,6 +260,7 @@ gdk_pixbuf_gif_anim_iter_advance (GdkPixbufAnimationIter *anim_iter,
{
GdkPixbufGifAnimIter
*
iter
;
gint
elapsed
;
gint
loop
;
GList
*
tmp
;
GList
*
old
;
...
...
@@ -285,12 +286,17 @@ gdk_pixbuf_gif_anim_iter_advance (GdkPixbufAnimationIter *anim_iter,
/* See how many times we've already played the full animation,
* and subtract time for that.
*/
loop
=
elapsed
/
iter
->
gif_anim
->
total_time
;
elapsed
=
elapsed
%
iter
->
gif_anim
->
total_time
;
iter
->
position
=
elapsed
;
/* Now move to the proper frame */
tmp
=
iter
->
gif_anim
->
frames
;
if
(
iter
->
gif_anim
->
loop
==
0
||
loop
<
iter
->
gif_anim
->
loop
)
tmp
=
iter
->
gif_anim
->
frames
;
else
tmp
=
NULL
;
while
(
tmp
!=
NULL
)
{
GdkPixbufFrame
*
frame
=
tmp
->
data
;
...
...
@@ -525,7 +531,7 @@ gdk_pixbuf_gif_anim_iter_get_pixbuf (GdkPixbufAnimationIter *anim_iter)
iter
=
GDK_PIXBUF_GIF_ANIM_ITER
(
anim_iter
);
frame
=
iter
->
current_frame
?
iter
->
current_frame
->
data
:
NULL
;
frame
=
iter
->
current_frame
?
iter
->
current_frame
->
data
:
g_list_last
(
iter
->
gif_anim
->
frames
)
->
data
;
#if 0
if (FALSE && frame)
...
...
gdk-pixbuf/io-gif-animation.h
View file @
817ad6d3
...
...
@@ -76,6 +76,8 @@ struct _GdkPixbufGifAnim {
guchar
bg_red
;
guchar
bg_green
;
guchar
bg_blue
;
int
loop
;
};
struct
_GdkPixbufGifAnimClass
{
...
...
gdk-pixbuf/io-gif.c
View file @
817ad6d3
...
...
@@ -83,7 +83,7 @@ enum {
GIF_GET_COLORMAP
,
GIF_GET_NEXT_STEP
,
GIF_GET_FRAME_INFO
,
GIF_GET_EXTEN
T
ION
,
GIF_GET_EXTEN
S
ION
,
GIF_GET_COLORMAP2
,
GIF_PREPARE_LZW
,
GIF_LZW_FILL_BUFFER
,
...
...
@@ -149,6 +149,7 @@ struct _GifContext
/* extension context */
guchar
extension_label
;
guchar
extension_flag
;
gboolean
in_loop_extension
;
/* get block context */
guchar
block_count
;
...
...
@@ -353,7 +354,7 @@ get_data_block (GifContext *context,
static
void
gif_set_get_extension
(
GifContext
*
context
)
{
context
->
state
=
GIF_GET_EXTEN
T
ION
;
context
->
state
=
GIF_GET_EXTEN
S
ION
;
context
->
extension_flag
=
TRUE
;
context
->
extension_label
=
0
;
context
->
block_count
=
0
;
...
...
@@ -376,8 +377,8 @@ gif_get_extension (GifContext *context)
}
switch
(
context
->
extension_label
)
{
case
0xf9
:
/* Graphic Control Extension */
retval
=
get_data_block
(
context
,
(
unsigned
char
*
)
context
->
block_buf
,
NULL
);
case
0xf9
:
/* Graphic Control Extension */
retval
=
get_data_block
(
context
,
(
unsigned
char
*
)
context
->
block_buf
,
NULL
);
if
(
retval
!=
0
)
return
retval
;
...
...
@@ -399,6 +400,36 @@ gif_get_extension (GifContext *context)
/* Now we've successfully loaded this one, we continue on our way */
context
->
block_count
=
0
;
context
->
extension_flag
=
FALSE
;
break
;
case
0xff
:
/* application extension */
if
(
!
context
->
in_loop_extension
)
{
retval
=
get_data_block
(
context
,
(
unsigned
char
*
)
context
->
block_buf
,
NULL
);
if
(
retval
!=
0
)
return
retval
;
if
(
!
strncmp
(
context
->
block_buf
,
"NETSCAPE2.0"
,
11
)
||
!
strncmp
(
context
->
block_buf
,
"ANIMEXTS1.0"
,
11
))
{
context
->
in_loop_extension
=
TRUE
;
context
->
block_count
=
0
;
}
}
if
(
context
->
in_loop_extension
)
{
do
{
retval
=
get_data_block
(
context
,
(
unsigned
char
*
)
context
->
block_buf
,
&
empty_block
);
if
(
retval
!=
0
)
return
retval
;
if
(
context
->
block_buf
[
0
]
==
0x01
)
{
context
->
animation
->
loop
=
context
->
block_buf
[
1
]
+
(
context
->
block_buf
[
2
]
<<
8
);
if
(
context
->
animation
->
loop
!=
0
)
context
->
animation
->
loop
++
;
}
context
->
block_count
=
0
;
}
while
(
!
empty_block
);
context
->
in_loop_extension
=
FALSE
;
context
->
extension_flag
=
FALSE
;
return
0
;
}
break
;
default:
/* Unhandled extension */
break
;
...
...
@@ -1280,7 +1311,7 @@ gif_main_loop (GifContext *context)
retval
=
gif_get_frame_info
(
context
);
break
;
case
GIF_GET_EXTEN
T
ION
:
case
GIF_GET_EXTEN
S
ION
:
LOG
(
"get_extension
\n
"
);
retval
=
gif_get_extension
(
context
);
if
(
retval
==
0
)
...
...
@@ -1349,6 +1380,8 @@ new_context (void)
context
->
gif89
.
delay_time
=
-
1
;
context
->
gif89
.
input_flag
=
-
1
;
context
->
gif89
.
disposal
=
-
1
;
context
->
animation
->
loop
=
1
;
context
->
in_loop_extension
=
FALSE
;
return
context
;
}
...
...
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