Last active
June 12, 2016 18:32
-
-
Save Sciss/03039a1216038c0f08c8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| val d = file("/media/hhrutz/MnemoN/BackupEzra091201/Users/rutz/Documents/Pictures/Scans/Ryoanji2009-04-04/") | |
| def toMonoPNG(in: File, inExt: String = "tif"): Unit = { | |
| val inFiles = in.children.filter(_.ext.toLowerCase == inExt).sortBy(_.name) | |
| println("#!/bin/bash\n") | |
| inFiles.foreach { inF => | |
| val outF = inF.replaceExt("png") | |
| val cmd = s"convert -threshold 50% '$inF' '$outF'" | |
| println(cmd) | |
| } | |
| } | |
| toMonoPNG(d) | |
| //////////////////////////////// | |
| val dIn = file("/home/hhrutz/Documents/projects/Eisenerz/photos/160612") | |
| val dOut = dIn / "web_scale" | |
| def resize50(in: File, out: File, inExt: String = "jpg"): Unit = { | |
| val inFiles = in.children.filter(_.ext.toLowerCase == inExt).sortBy(_.name) | |
| println("#!/bin/bash\n") | |
| inFiles.foreach { inF => | |
| val outF = out / s"${inF.base}m.jpg" | |
| require (!outF.exists()) | |
| val cmd = s"convert -resize 50% '$inF' '$outF'" | |
| println(cmd) | |
| } | |
| } | |
| resize50(dIn, dOut) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment