gifsicle breaks the gifs. -_-
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -9,7 +9,7 @@ IP = ARGV[0]
|
||||
PORT = 2122
|
||||
FILE = ARGV[1] or raise "No filename given"
|
||||
EFFECT = ARGV[2]
|
||||
FRAMES = 250
|
||||
FRAMES = 125
|
||||
FACTOR = 1
|
||||
delay = 50
|
||||
|
||||
@@ -53,20 +53,13 @@ while gif.length < FRAMES do
|
||||
|
||||
id = data.shift << 8 | data.shift
|
||||
if last_id != id-1 && last_id != id-2
|
||||
puts
|
||||
puts "Skipped from #{last_id} to #{id}."
|
||||
gif = ImageList.new
|
||||
end
|
||||
last_id = id
|
||||
|
||||
if img && last_frame_time
|
||||
last_diff = diff = Time.now.to_f * 100 - last_frame_time.to_f * 100
|
||||
img.delay = diff
|
||||
end
|
||||
|
||||
last_frame_time = Time.now
|
||||
|
||||
img = Image.new(dim_x, dim_y)
|
||||
img.delay = 5
|
||||
img.delay = 1
|
||||
gc = Draw.new
|
||||
|
||||
#next
|
||||
@@ -84,10 +77,10 @@ while gif.length < FRAMES do
|
||||
img.sample!(FACTOR)
|
||||
gif << img
|
||||
end
|
||||
img.delay = last_diff
|
||||
s.close
|
||||
puts
|
||||
puts "Generating gif..."
|
||||
gif.ticks_per_second = 100
|
||||
gif.write(FILE)
|
||||
puts
|
||||
puts
|
||||
|
Reference in New Issue
Block a user