Changeset 18108 in josm for trunk/src/org
- Timestamp:
- 2021-08-01T22:00:25+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer/geoimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r17880 r18108 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.layer.geoimage; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.awt.Dimension; … … 15 17 import java.util.Objects; 16 18 19 import javax.imageio.IIOParam; 20 import javax.imageio.ImageReadParam; 21 import javax.imageio.ImageReader; 22 17 23 import org.openstreetmap.josm.data.ImageData; 18 24 import org.openstreetmap.josm.data.gpx.GpxImageEntry; … … 20 26 import org.openstreetmap.josm.tools.ImageProvider; 21 27 import org.openstreetmap.josm.tools.Logging; 22 23 import javax.imageio.IIOParam;24 import javax.imageio.ImageReadParam;25 import javax.imageio.ImageReader;26 27 import static org.openstreetmap.josm.tools.I18n.tr;28 28 29 29 /** … … 139 139 * Reads the image represented by this entry in the given target dimension. 140 140 * @param target the desired dimension used for {@linkplain IIOParam#setSourceSubsampling subsampling} or {@code null} 141 * @return the read image 141 * @return the read image, or {@code null} 142 142 * @throws IOException if any I/O error occurs 143 143 */ … … 147 147 BufferedImage image = ImageProvider.read(imageUrl, false, false, 148 148 r -> target == null ? r.getDefaultReadParam() : withSubsampling(r, target)); 149 if (image == null) { 150 Logging.warn("Unable to load {0}", imageUrl); 151 return null; 152 } 149 153 Logging.debug("Loaded {0} with dimensions {1}x{2} memoryTaken={3}m exifOrientationSwitchedDimension={4}", 150 154 imageUrl, image.getWidth(), image.getHeight(), image.getWidth() * image.getHeight() * 4 / 1024 / 1024, -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
r17873 r18108 114 114 } 115 115 116 if (img .getWidth() <= 0 || img.getHeight() <= 0) {116 if (img == null || img.getWidth() <= 0 || img.getHeight() <= 0) { 117 117 Logging.error(" Invalid image"); 118 118 return null;
Note:
See TracChangeset
for help on using the changeset viewer.