slibexif


License

License

Categories

Categories

Net
GroupId

GroupId

net.n12n.exif
ArtifactId

ArtifactId

slibexif_2.10
Last Version

Last Version

0.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

slibexif
slibexif
Project URL

Project URL

https://github.com/ngrossmann/slibexif
Project Organization

Project Organization

net.n12n.exif
Source Code Management

Source Code Management

https://github.com/ngrossmann/slibexif

Download slibexif_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/net.n12n.exif/slibexif_2.10/ -->
<dependency>
    <groupId>net.n12n.exif</groupId>
    <artifactId>slibexif_2.10</artifactId>
    <version>0.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/net.n12n.exif/slibexif_2.10/
implementation 'net.n12n.exif:slibexif_2.10:0.3.1'
// https://jarcasting.com/artifacts/net.n12n.exif/slibexif_2.10/
implementation ("net.n12n.exif:slibexif_2.10:0.3.1")
'net.n12n.exif:slibexif_2.10:jar:0.3.1'
<dependency org="net.n12n.exif" name="slibexif_2.10" rev="0.3.1">
  <artifact name="slibexif_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.n12n.exif', module='slibexif_2.10', version='0.3.1')
)
libraryDependencies += "net.n12n.exif" % "slibexif_2.10" % "0.3.1"
[net.n12n.exif/slibexif_2.10 "0.3.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.4

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 2.1.7

Project Modules

There are no modules declared in this project.

slibexif

Build Status

Scala library to read JPEG Exif data. The library has no dependencies on any other libraries including javax.imageio.*.

Examples

Read GPS attributes:

  for {
    exif <- JpegMetaData(args("image.jpg")).exif
    lat <- exif.value(GpsIfd.GPSLatitude)
    lng <- exif.value(GpsIfd.GPSLongitude)
  } yield println(s"${tos(lat)}, ${tos(lng)}")


  def tos(r: List[Rational]): String = {
    val List(deg, min, sec) = r
    s"""${deg.toDouble}°${min.toDouble}'${sec.toDouble}\""""
  }

Prints something like 48.0°9.0'47.12, 11.0°35.0'49.931.

List all attributes of an image:

    JpegMetaData("image.jpg").exif.foreach(_.ifds.flatMap(_.attributes).foreach(
      attr => println(s"${attr.tag.name}: ${attr.value}")))

Prints

Make: Samsung
Model: Galaxy Nexus
Orientation: 1
XResolution: 72/1
YResolution: 72/1
ResolutionUnit: 2
DateTime: 2013:01:29 22:31:15
YCbCrPositioning: 1
ExifIfdPointer: 192
GpsInfoIfdPointer: 860
ImageWidth: 160
ImageLength: 120
Compression: 6
XResolution: 72/1
YResolution: 72/1
ResolutionUnit: 2
JPEGInterchangeFormat: 1284
JPEGInterchangeFormatLength: 3482
ExposureTime: 862/1000000
...

Using slibexif

slibexif for Scala 2.10 and 2.11 is available on the Maven Central repository, just add libraryDependencies += "net.n12n.exif" %% "slibexif" % "0.3.1" to your build.

Check the slibexif API scaladocs for more details.

Versions

Version
0.3.1