diff --git a/src/tools/gif2c.rb b/src/tools/gif2c.rb index e30f119..7f5677a 100755 --- a/src/tools/gif2c.rb +++ b/src/tools/gif2c.rb @@ -70,9 +70,14 @@ if times.uniq.count==1 times = times[0, 1] end +total_x, total_y = frames.first.columns, frames.first.rows + STDERR.print "Getting colors..." colors = [] frames.each do |frame| + if frame.columns!=total_x || frame.rows!=total_y + raise "The gif file has frames with different sizes. Such gifs are not supported at the moment, sorry." + end frame.columns.times do |x| frame.rows.times do |y| color = frame.pixel_color(x, y).to_color(Magick::AllCompliance, true, 8, true)[1,8].to_i(16)