lib/google-map-stitch/stitcher.rb in google-map-stitch-0.1.3 vs lib/google-map-stitch/stitcher.rb in google-map-stitch-0.1.4
- old
+ new
@@ -9,22 +9,22 @@
@dir = dir
@output_file = output_file
end
def tiles
- Dir.glob(File.join(dir,"*")).map do |path|
- Dir.glob(File.join(path,"*.png")).map do |image|
+ Dir.glob(File.join(dir,"*")).sort.map do |path|
+ Dir.glob(File.join(path,"*.png")).sort.map do |image|
image
end
end
end
def process
output = Magick::ImageList.new
tiles.each do |row|
column = Magick::ImageList.new
- row.each do |file|
+ row.sort.each do |file|
puts "Combining #{file}"
column.push(Magick::Image.read(file).first)
end
output.push(column.append(true))
end