The following commit has been merged in the master branch:
commit 0de6632747e22828dd3c95c25dd816813cddbd4b
Author: Andrew Shadura <and...@shadura.me>
Date:   Wed Jan 15 23:34:01 2014 +0100

    Build against libmetadata-extractor-java 2.6.4

diff --git a/debian/control b/debian/control
index d647a64..975e6c2 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Build-Depends:
  , default-jdk
  , libcommons-codec-java
  , libgettext-commons-java (>= 0.9.6)
- , libmetadata-extractor-java (<< 2.4.0)
+ , libmetadata-extractor-java (>= 2.6.4)
  , libgettext-ant-tasks-java
  , liboauth-signpost-java (>= 1.2)
  , libsvgsalamander-java
@@ -31,7 +31,7 @@ Depends:
  openjdk-6-jre | sun-java6-jre | openjdk-7-jre
  , libcommons-codec-java
  , libgettext-commons-java (>= 0.9.6)
- , libmetadata-extractor-java (<< 2.4.0)
+ , libmetadata-extractor-java (>= 2.6.4)
  , liboauth-signpost-java (>= 1.2)
  , libsvgsalamander-java
  , openstreetmap-map-icons-classic
diff --git a/debian/patches/07-downgrade-metadata-extractor.patch 
b/debian/patches/07-downgrade-metadata-extractor.patch
deleted file mode 100644
index 6633997..0000000
--- a/debian/patches/07-downgrade-metadata-extractor.patch
+++ /dev/null
@@ -1,161 +0,0 @@
---- a/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
-+++ b/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
-@@ -69,7 +69,7 @@
- import com.drew.metadata.Directory;
- import com.drew.metadata.Metadata;
- import com.drew.metadata.MetadataException;
--import com.drew.metadata.exif.ExifIFD0Directory;
-+import com.drew.metadata.exif.ExifDirectory;
- import com.drew.metadata.exif.GpsDirectory;
- 
- /**
-@@ -554,21 +554,17 @@
- 
-         try {
-             metadata = JpegMetadataReader.readMetadata(e.getFile());
--            dirExif = metadata.getDirectory(ExifIFD0Directory.class);
--            dirGps = metadata.getDirectory(GpsDirectory.class);
-+            dirExif = metadata.getDirectory(ExifDirectory.class);
-+            dirGps = (GpsDirectory) metadata.getDirectory(GpsDirectory.class);
-         } catch (CompoundException p) {
-             e.setExifCoor(null);
-             e.setPos(null);
-             return;
--        } catch (IOException p) {
--            e.setExifCoor(null);
--            e.setPos(null);
--            return;
-         }
- 
-         try {
-             if (dirExif != null) {
--                int orientation = 
dirExif.getInt(ExifIFD0Directory.TAG_ORIENTATION);
-+                int orientation = 
dirExif.getInt(ExifDirectory.TAG_ORIENTATION);
-                 e.setExifOrientation(orientation);
-             }
-         } catch (MetadataException ex) {
-@@ -614,7 +610,12 @@
-         // 1) GPS_TIME_STAMP not set -> date/time will be null
-         // 2) GPS_DATE_STAMP not set -> use EXIF date or set to default
-         // 3) GPS_TIME_STAMP and GPS_DATE_STAMP are set
--        int[] timeStampComps = 
dirGps.getIntArray(GpsDirectory.TAG_GPS_TIME_STAMP);
-+        int[] timeStampComps = null;
-+        try {
-+            timeStampComps = 
dirGps.getIntArray(GpsDirectory.TAG_GPS_TIME_STAMP);
-+        } catch (MetadataException ex) {
-+            // Do nothing
-+        }
-         if (timeStampComps != null) {
-             int gpsHour = timeStampComps[0];
-             int gpsMin = timeStampComps[1];
-@@ -623,7 +624,7 @@
- 
-             // We have the time. Next step is to check if the GPS date stamp 
is set.
-             // dirGps.getString() always succeeds, but the return value might 
be null.
--            String dateStampStr = 
dirGps.getString(GpsDirectory.TAG_GPS_DATE_STAMP);
-+            String dateStampStr = dirGps.getString(0x001D /* 
GpsDirectory.TAG_GPS_DATE_STAMP */);
-             if (dateStampStr != null && 
dateStampStr.matches("^\\d+:\\d+:\\d+$")) {
-                 String[] dateStampComps = dateStampStr.split(":");
-                 cal.set(Calendar.YEAR, Integer.parseInt(dateStampComps[0]));
---- a/src/org/openstreetmap/josm/tools/ExifReader.java
-+++ b/src/org/openstreetmap/josm/tools/ExifReader.java
-@@ -5,6 +5,7 @@
- import java.io.IOException;
- import java.text.ParseException;
- import java.util.Date;
-+import java.util.Iterator;
- 
- import org.openstreetmap.josm.Main;
- import org.openstreetmap.josm.data.coor.LatLon;
-@@ -16,8 +17,7 @@
- import com.drew.metadata.Metadata;
- import com.drew.metadata.MetadataException;
- import com.drew.metadata.Tag;
--import com.drew.metadata.exif.ExifIFD0Directory;
--import com.drew.metadata.exif.ExifSubIFDDirectory;
-+import com.drew.metadata.exif.ExifDirectory;
- import com.drew.metadata.exif.GpsDirectory;
- 
- /**
-@@ -42,14 +42,15 @@
-             Metadata metadata = JpegMetadataReader.readMetadata(filename);
-             String dateStr = null;
-             OUTER:
--            for (Directory dirIt : metadata.getDirectories()) {
--                for (Tag tag : dirIt.getTags()) {
--                    if (tag.getTagType() == 
ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL /* 0x9003 */) {
-+            for (Iterator<Directory> dirIt = metadata.getDirectoryIterator(); 
dirIt.hasNext();) {
-+                for (Iterator<Tag> tagIt = dirIt.next().getTagIterator(); 
tagIt.hasNext();) {
-+                    Tag tag = tagIt.next();
-+                    if (tag.getTagType() == 
ExifDirectory.TAG_DATETIME_ORIGINAL /* 0x9003 */) {
-                         dateStr = tag.getDescription();
-                         break OUTER; // prefer this tag
-                     }
--                    if (tag.getTagType() == ExifIFD0Directory.TAG_DATETIME /* 
0x0132 */ ||
--                        tag.getTagType() == 
ExifSubIFDDirectory.TAG_DATETIME_DIGITIZED /* 0x9004 */) {
-+                    if (tag.getTagType() == ExifDirectory.TAG_DATETIME /* 
0x0132 */ ||
-+                        tag.getTagType() == 
ExifDirectory.TAG_DATETIME_DIGITIZED /* 0x9004 */) {
-                         dateStr = tag.getDescription();
-                     }
-                 }
-@@ -84,14 +85,12 @@
-     public static Integer readOrientation(File filename) {
-         try {
-             final Metadata metadata = 
JpegMetadataReader.readMetadata(filename);
--            final Directory dir = 
metadata.getDirectory(ExifIFD0Directory.class);
--            return dir.getInt(ExifIFD0Directory.TAG_ORIENTATION);
-+            final Directory dir = metadata.getDirectory(ExifDirectory.class);
-+            return dir.getInt(ExifDirectory.TAG_ORIENTATION);
-         } catch (JpegProcessingException e) {
-             Main.error(e);
-         } catch (MetadataException e) {
-             Main.error(e);
--        } catch (IOException e) {
--            Main.error(e);
-         }
-         return null;
-     }
-@@ -105,12 +104,10 @@
-     public static LatLon readLatLon(File filename) {
-         try {
-             final Metadata metadata = 
JpegMetadataReader.readMetadata(filename);
--            final GpsDirectory dirGps = 
metadata.getDirectory(GpsDirectory.class);
-+            final GpsDirectory dirGps = (GpsDirectory) 
metadata.getDirectory(GpsDirectory.class);
-             return readLatLon(dirGps);
-         } catch (JpegProcessingException e) {
-             Main.error(e);
--        } catch (IOException e) {
--            Main.error(e);
-         } catch (MetadataException e) {
-             Main.error(e);
-         }
-@@ -142,12 +139,10 @@
-     public static Double readDirection(File filename) {
-         try {
-             final Metadata metadata = 
JpegMetadataReader.readMetadata(filename);
--            final GpsDirectory dirGps = 
metadata.getDirectory(GpsDirectory.class);
-+            final GpsDirectory dirGps = (GpsDirectory) 
metadata.getDirectory(GpsDirectory.class);
-             return readDirection(dirGps);
-         } catch (JpegProcessingException e) {
-             Main.error(e);
--        } catch (IOException e) {
--            Main.error(e);
-         }
-         return null;
-     }
-@@ -160,9 +155,12 @@
-      */
-     public static Double readDirection(GpsDirectory dirGps) {
-         if (dirGps != null) {
--            Rational direction = 
dirGps.getRational(GpsDirectory.TAG_GPS_IMG_DIRECTION);
--            if (direction != null) {
--                return direction.doubleValue();
-+            try {
-+                Rational direction = 
dirGps.getRational(GpsDirectory.TAG_GPS_IMG_DIRECTION);
-+                if (direction != null) {
-+                    return direction.doubleValue();
-+                }
-+            } catch (MetadataException ex) {
-             }
-         }
-         return null;
diff --git a/debian/patches/series b/debian/patches/series
index 061cbaa..320864c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,4 +5,3 @@
 05-fix_version.patch
 #100-fix_SlippyMapBBoxChooser.patch
 06-move_data_out_of_jar.patch
-07-downgrade-metadata-extractor.patch

-- 
Editor for OpenStreetMap

_______________________________________________
Pkg-osm-commits mailing list
Pkg-osm-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-osm-commits

Reply via email to