Created
April 6, 2016 04:05
-
-
Save innerlee/bb9affd9aa194efdcaa84e9351f4748c to your computer and use it in GitHub Desktop.
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
# resize images to 256x256 using packages | |
# identify -format "(%w,%h)" n12552309_5.JPEG | |
# mogrify -resize 256x256! n12552309_10.JPEG | |
imgsize(img) = eval(parse(readstring(`identify -format "(%w,%h)" $img`))) | |
resize(img) = run(`mogrify -resize 256x256! $img`) | |
for folder in filter(x->isdir(x), readdir()) | |
println("\n>$folder") | |
for img in filter(x->isfile("$folder/$x") && length(x)>5 && lowercase(x[end-4:end]) == ".jpeg", readdir(folder)) | |
if imgsize("$folder/$img") != (256,256) | |
resize("$folder/$img") | |
print(".") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment