Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getFileNumber(fileName)
- parts = fileName.split('_')
- return parts[parts.length-1].split('.')[0];
- end
- source = ARGV[0]
- destination = ARGV[1]
- direction = 0
- command = "convert \\("
- images = Dir.entries("./#{source}").sort
- images.each do |imageFile|
- next if imageFile == '.' or imageFile == '..'
- fileNumber = getFileNumber(imageFile)
- if (fileNumber[0].to_i > direction)
- direction += 1
- command.concat(" +append \\) \\(")
- end
- command.concat(" #{source}/#{imageFile} ")
- end
- command.concat(" +append \\) -background none -append #{destination}")
- system(command)
Add Comment
Please, Sign In to add comment