Skip gif animation optimization in case both frames are identical
This works around an issue in libgd2 library which would otherwise cause segfaults due to zero sized images
This commit is contained in:
parent
ab6d657992
commit
7f138fb014
1 changed files with 3 additions and 1 deletions
|
@ -103,7 +103,9 @@ module GPX
|
|||
res = GD2::AnimatedGif.gif_anim_begin(frames[0])
|
||||
res << GD2::AnimatedGif.gif_anim_add(frames[0], nil, delay)
|
||||
(1...nframes).each do |n|
|
||||
res << GD2::AnimatedGif.gif_anim_add(frames[n], frames[n - 1], delay)
|
||||
res << GD2::AnimatedGif.gif_anim_add(frames[n],
|
||||
(frames[n] == frames[n - 1] ? nil : frames[n - 1]),
|
||||
delay)
|
||||
end
|
||||
res << GD2::AnimatedGif.gif_anim_end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue