-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b99f9cf
commit fba6a5e
Showing
9 changed files
with
92 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package net.n12n.exif | ||
import java.io.IOException | ||
|
||
object Exif extends App { | ||
try { | ||
if (args.length != 1) | ||
usage() | ||
val image = JpegMetaData(args(0)) | ||
for (exif <- image.exif) { | ||
println("Exif (length: %d):".format(exif.length)) | ||
exif.ifds.foreach(printIfd) | ||
val xres: Rational = exif.ifd0.value(TiffIfd.XResolution) | ||
} | ||
} catch { | ||
case e: IOException => | ||
System.err.println("Faild to open %s for reading".format(args(0))) | ||
System.exit(2) | ||
} | ||
|
||
private def usage() { | ||
System.err.println("Usage: Exif <path>") | ||
System.exit(1) | ||
} | ||
|
||
private def printIfd(ifd: Ifd) { | ||
println("IFD: %s".format(ifd.name)) | ||
ifd.tags.foreach(a => println(" %s: %s".format(a.tag.name, a.value))) | ||
} | ||
} |
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
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
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
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
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
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
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
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