Created
June 27, 2012 13:40
-
-
Save anonymous/3004115 to your computer and use it in GitHub Desktop.
webrick, convert jpg to video then return response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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