Changeset 17553 in josm
- Timestamp:
- 2021-03-07T14:44:14+01:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
r17548 r17553 5 5 6 6 import java.io.File; 7 import java.io.IOException; 7 8 import java.util.Date; 8 9 import java.util.List; 10 import java.util.Locale; 9 11 import java.util.Objects; 10 12 import java.util.function.Consumer; … … 19 21 20 22 import com.drew.imaging.jpeg.JpegMetadataReader; 23 import com.drew.imaging.jpeg.JpegProcessingException; 21 24 import com.drew.imaging.png.PngMetadataReader; 25 import com.drew.imaging.png.PngProcessingException; 22 26 import com.drew.imaging.tiff.TiffMetadataReader; 27 import com.drew.imaging.tiff.TiffProcessingException; 23 28 import com.drew.metadata.Directory; 24 29 import com.drew.metadata.Metadata; … … 588 593 try { 589 594 // try to parse metadata according to extension 590 String ext = fn.substring(fn.lastIndexOf( ".") + 1).toLowerCase();595 String ext = fn.substring(fn.lastIndexOf('.') + 1).toLowerCase(Locale.US); 591 596 switch (ext) { 592 597 case "jpg": … … 604 609 throw new NoMetadataReaderWarning(ext); 605 610 } 606 } catch (Exception topException) { 611 } catch (JpegProcessingException | TiffProcessingException | PngProcessingException | IOException 612 | NoMetadataReaderWarning topException) { 607 613 //try other formats (e.g. JPEG file with .png extension) 608 614 try { 609 615 metadata = JpegMetadataReader.readMetadata(file); 610 } catch ( Exception ex1) {616 } catch (JpegProcessingException | IOException ex1) { 611 617 try { 612 618 metadata = TiffMetadataReader.readMetadata(file); 613 } catch ( Exception ex2) {619 } catch (TiffProcessingException | IOException ex2) { 614 620 try { 615 621 metadata = PngMetadataReader.readMetadata(file); 616 } catch (Exception ex3) { 617 622 } catch (PngProcessingException | IOException ex3) { 618 623 Logging.warn(topException); 619 624 Logging.info(tr("Can''t parse metadata for file \"{0}\". Using last modified date as timestamp.", fn)); -
trunk/src/org/openstreetmap/josm/gui/io/importexport/ImageImporter.java
r17548 r17553 8 8 import java.util.ArrayList; 9 9 import java.util.Arrays; 10 import java.util.Collections; 10 11 import java.util.HashSet; 11 12 import java.util.List; 12 13 import java.util.Set; 14 import java.util.stream.Collectors; 13 15 14 16 import javax.imageio.ImageIO; … … 30 32 * The supported image file types on the current system 31 33 */ 32 public static final String[] SUPPORTED_FILE_TYPES = ImageIO.getReaderFileSuffixes(); 34 public static final List<String> SUPPORTED_FILE_TYPES = Collections 35 .unmodifiableList(Arrays.stream(ImageIO.getReaderFileSuffixes()).sorted().collect(Collectors.toList())); 33 36 34 37 /** -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
r17548 r17553 243 243 244 244 private boolean updateImageEntry(Image img) { 245 if (img == null) { 246 synchronized (ImageDisplay.this) { 247 errorLoading = true; 248 ImageDisplay.this.repaint(); 249 return false; 250 } 251 } 245 252 if (!(entry.getWidth() > 0 && entry.getHeight() > 0)) { 246 253 synchronized (entry) {
Note:
See TracChangeset
for help on using the changeset viewer.