Skip to content

Instantly share code, notes, and snippets.

@u1tnk
Last active December 14, 2015 13:59
Show Gist options
  • Save u1tnk/5097541 to your computer and use it in GitHub Desktop.
Save u1tnk/5097541 to your computer and use it in GitHub Desktop.
画像ファイルのサイズ一覧からでかいの検出した
#!/usr/bin/env ruby
File.open('ids.txt') do |file|
while line = file.gets do
words = line.split(' ')
size = eval(words[1].gsub('x', '*'))
if size >= 640 * 960
p(words)
end
end
end
find . -type f -name "*.jpg" | xargs identify | awk '{print $1 " " $3}' > ids.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment