Changeset 17363 in josm for trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
- Timestamp:
- 2020-11-26T22:24:24+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
r16398 r17363 9 9 import java.awt.geom.AffineTransform; 10 10 import java.awt.image.BufferedImage; 11 import java.io.ByteArrayOutputStream;12 11 import java.io.File; 13 12 import java.io.IOException; 13 import java.io.UncheckedIOException; 14 14 import java.util.ArrayList; 15 15 import java.util.Collection; 16 17 import javax.imageio.ImageIO;18 16 19 17 import org.apache.commons.jcs3.access.behavior.ICacheAccess; … … 165 163 166 164 if (!cacheOff && cache != null) { 167 try (ByteArrayOutputStream output = new ByteArrayOutputStream()) { 168 ImageIO.write(scaledBI, "png", output); 169 cache.put(cacheIdent, new BufferedImageCacheEntry(output.toByteArray())); 170 } catch (IOException e) { 165 try { 166 cache.put(cacheIdent, BufferedImageCacheEntry.pngEncoded(scaledBI)); 167 } catch (UncheckedIOException e) { 171 168 Logging.warn("Failed to save geoimage thumb to cache"); 172 169 Logging.warn(e);
Note:
See TracChangeset
for help on using the changeset viewer.