Skip to content

Instantly share code, notes, and snippets.

Created June 27, 2012 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3004115 to your computer and use it in GitHub Desktop.
Save anonymous/3004115 to your computer and use it in GitHub Desktop.
webrick, convert jpg to video then return response
require 'RMagick'
myFiles=Dir["*.jpg"].sort
p myFiles
i = Magick::ImageList.new(*myFiles)
p i.length
i.delay = 50
i.write "animated7.mpg"
# Now webrick code
# imgFileList is an array
tempRes = Magick::ImageList.new(*imgFileList)
tempRes.delay = 50
res.body = tempRes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment