Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# This script assumes a dump of images from the Everyday iOS app.
# It distributes all images from images/ into N subdirectories,
# starting with 1 and proceeding to N.
# the intention is to load these images into a video editor
# to make a variant of Kalina's videos that shows multiple
# images at once.
require 'FileUtils'
print "Looking for images in folder 'images'... "
Dir.chdir("images")
images = Dir['*.jpg'].sort_by{ |f| File.mtime(f) }
puts "Found #{images.size}."
n = 3
c = 0
print "Copying into #{3} subfolders... "
images.each do |image|
c+=1
folder = (c % n + 1).to_s
Dir.mkdir(folder) if !Dir.exists?(folder)
FileUtils.copy_entry(image, "#{folder}/#{image}", true)
end
puts "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.