-
Notifications
You must be signed in to change notification settings - Fork 2
ImageList#write
Junichi Kajiwara edited this page Jul 22, 2016
·
2 revisions
GIFの場合、複数枚の画像を意識した処理を行う。
def write(path)
if path.split('.')[-1] == 'gif'
# p @frames.length
if @frames.length > 0
# 複数のImageからblobを取り出し、これをgifとして保存する。
blobs = []
blobs.push(@image.to_blob)
@frames.each do|imglist|
blobs.push(imglist.to_blob)
end
# p blobs.length
Mrmagick::Capi.write_gif(path, blobs)
else
@image.write(path)
end
else
@image.write(path)
end
end