Changeset 8765 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2015-09-18T00:59:57+02:00 (9 years ago)
Author:
Don-vip
Message:

fix #11867 - ThumbsLoader freezes if EXIF orientation is not set (patch by holgermappt)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java

    r8764 r8765  
    100100        final int h = img.getHeight(null);
    101101        final int hh, ww;
    102         if (ExifReader.orientationSwitchesDimensions(entry.getExifOrientation())) {
     102        final Integer exifOrientation = entry.getExifOrientation();
     103        if (exifOrientation != null && ExifReader.orientationSwitchesDimensions(exifOrientation)) {
    103104            ww = h;
    104105            hh = w;
     
    114115        Graphics2D g = scaledBI.createGraphics();
    115116
    116         final AffineTransform restoreOrientation = ExifReader.getRestoreOrientationTransform(entry.getExifOrientation(), w, h);
    117117        final AffineTransform scale = AffineTransform.getScaleInstance((double) targetSize.width / ww, (double) targetSize.height / hh);
    118         scale.concatenate(restoreOrientation);
     118        if (exifOrientation != null) {
     119            final AffineTransform restoreOrientation = ExifReader.getRestoreOrientationTransform(exifOrientation, w, h);
     120            scale.concatenate(restoreOrientation);
     121        }
    119122
    120123        while (!g.drawImage(img, scale, null)) {
Note: See TracChangeset for help on using the changeset viewer.