ruby-libgd

close

gif.close

Finalizes the animated GIF and completes file writing.


Overview

close finishes the GIF encoding process by writing the GIF trailer and closing the underlying file handle.

Calling this method ensures the animated GIF is valid and properly formatted.


Behavior


Safety


Notes


Example

gif = GD::Gif.new("animation.gif")

img = GD::Image.new(200, 200)
img.filled_circle(100, 100, 50, GD::Color.rgb(0, 128, 255))

gif.add_frame(img)
gif.close