Do not catch graphics exception too early (#413)
This commit is contained in:
@@ -111,9 +111,9 @@ public abstract class CanvasAdapter {
|
||||
* @param inputStream the input stream
|
||||
* @return the bitmap
|
||||
*/
|
||||
protected abstract Bitmap decodeBitmapImpl(InputStream inputStream);
|
||||
protected abstract Bitmap decodeBitmapImpl(InputStream inputStream) throws IOException;
|
||||
|
||||
public static Bitmap decodeBitmap(InputStream inputStream) {
|
||||
public static Bitmap decodeBitmap(InputStream inputStream) throws IOException {
|
||||
return g.decodeBitmapImpl(inputStream);
|
||||
}
|
||||
|
||||
@@ -123,9 +123,9 @@ public abstract class CanvasAdapter {
|
||||
* @param inputStream the input stream
|
||||
* @return the SVG bitmap
|
||||
*/
|
||||
protected abstract Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent);
|
||||
protected abstract Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException;
|
||||
|
||||
public static Bitmap decodeSvgBitmap(InputStream inputStream, int width, int height, int percent) {
|
||||
public static Bitmap decodeSvgBitmap(InputStream inputStream, int width, int height, int percent) throws IOException {
|
||||
return g.decodeSvgBitmapImpl(inputStream, width, height, percent);
|
||||
}
|
||||
|
||||
@@ -136,13 +136,13 @@ public abstract class CanvasAdapter {
|
||||
* @param src the resource
|
||||
* @return the bitmap
|
||||
*/
|
||||
protected abstract Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent);
|
||||
protected abstract Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent) throws IOException;
|
||||
|
||||
public static Bitmap getBitmapAsset(String relativePathPrefix, String src) {
|
||||
public static Bitmap getBitmapAsset(String relativePathPrefix, String src) throws IOException {
|
||||
return getBitmapAsset(relativePathPrefix, src, 0, 0, 100);
|
||||
}
|
||||
|
||||
public static Bitmap getBitmapAsset(String relativePathPrefix, String src, int width, int height, int percent) {
|
||||
public static Bitmap getBitmapAsset(String relativePathPrefix, String src, int width, int height, int percent) throws IOException {
|
||||
return g.loadBitmapAssetImpl(relativePathPrefix, src, width, height, percent);
|
||||
}
|
||||
|
||||
|
||||
@@ -1039,7 +1039,7 @@ public class XmlMapsforgeThemeBuilder extends DefaultHandler {
|
||||
try {
|
||||
b.bitmap = CanvasAdapter.getBitmapAsset(mTheme.getRelativePathPrefix(), symbol, b.symbolWidth, b.symbolHeight, b.symbolPercent);
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
log.error("{}: {}", symbol, e.getMessage());
|
||||
}
|
||||
} else
|
||||
b.texture = getAtlasRegion(symbol);
|
||||
@@ -1132,7 +1132,7 @@ public class XmlMapsforgeThemeBuilder extends DefaultHandler {
|
||||
if (bitmap != null)
|
||||
return buildSymbol(b, src, bitmap);
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
log.error("{}: {}", src, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ public class XmlThemeBuilder extends DefaultHandler {
|
||||
try {
|
||||
b.bitmap = CanvasAdapter.getBitmapAsset(mTheme.getRelativePathPrefix(), symbol, b.symbolWidth, b.symbolHeight, b.symbolPercent);
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
log.error("{}: {}", symbol, e.getMessage());
|
||||
}
|
||||
} else
|
||||
b.texture = getAtlasRegion(symbol);
|
||||
@@ -1109,7 +1109,7 @@ public class XmlThemeBuilder extends DefaultHandler {
|
||||
if (bitmap != null)
|
||||
return buildSymbol(b, src, bitmap);
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage());
|
||||
log.error("{}: {}", src, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class Utils {
|
||||
return new TextureItem(bitmap, true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.debug("missing file / {}", e.getMessage());
|
||||
log.error("{}: missing file / {}", src, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user