(String key)
| 14 | |
| 15 | final class ImageLoader extends CacheLoader<String, BufferedImage> { |
| 16 | @Override |
| 17 | public BufferedImage load(String key) { |
| 18 | if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_DISABLE_CARD_IMAGES)) |
| 19 | return null; |
| 20 | |
| 21 | File file = ImageKeys.getImageFile(key); |
| 22 | if (file != null) { |
| 23 | if (!file.exists()) { |
| 24 | return null; |
| 25 | } |
| 26 | if (file.isDirectory()) { |
| 27 | file.delete(); |
| 28 | return null; |
| 29 | } |
| 30 | try { |
| 31 | //it seems twelvemonkeys plugin handles the cmyk and other non standard colorspace jpeg automaticaly :) |
| 32 | return ImageIO.read(file); |
| 33 | } |
| 34 | catch (IOException ex) { |
| 35 | BugReporter.reportException(ex, "Could not read image file " + file.getAbsolutePath() + " "); |
| 36 | } |
| 37 | } |
| 38 | return null; |
| 39 | } |
| 40 | } |
nothing calls this directly
no test coverage detected