Skip to content

Instantly share code, notes, and snippets.

@ir-norn
Created October 1, 2015 18:25
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 ir-norn/f1a9d9fa7c8af284db78 to your computer and use it in GitHub Desktop.
Save ir-norn/f1a9d9fa7c8af284db78 to your computer and use it in GitHub Desktop.
chrome data saver
#
# webp jpg
# フォルダが存在すればtrue
if system"copy *.* tmp\\*.*"
system"nconvert -D -out jpeg *.jpg"
Dir["*.*"].each do|m|
next if File.extname(m) == ".rb" # rb script だけ除外
# _1 がつくのでそれをrename
b = File.basename(m, '.*')
if b[-2..-1] == "_1"
b[-2..-1] = ""
end
File.rename m , b + ".jpg"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment