Skip to content

Instantly share code, notes, and snippets.

@JRJurman
Created February 23, 2015 22:39
Show Gist options
  • Select an option

  • Save JRJurman/9b36301594d4e568903c to your computer and use it in GitHub Desktop.

Select an option

Save JRJurman/9b36301594d4e568903c to your computer and use it in GitHub Desktop.
Making images into folders
Dir.glob("*.png").each do |img|
fimg = img.sub( /\.\S*/, "" )
puts fimg
`mkdir #{fimg}`
`touch #{fimg}/full_text.txt`
`mv #{img} #{fimg}/full.png`
`cp #{fimg}/full.png #{fimg}/thumb.png`
`sips #{fimg}/thumb.png --resampleHeightWidth 400 570`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment