Changed createTransparentImage -> createImage. If a null color is used,

it will be transparent
This commit is contained in:
nathan 2017-07-08 23:58:08 +02:00
parent 133cb9f8f8
commit 10be3e302f

View File

@ -48,13 +48,13 @@ class ImageResizeUtil {
// NOTE: this does not need to be called on the EDT // NOTE: this does not need to be called on the EDT
try { try {
final File newFile = CacheUtil.create(imageSize + "_empty.png"); final File newFile = CacheUtil.create(imageSize + "_empty.png");
return ImageUtil.getTransparentImage(imageSize, newFile); return ImageUtil.createImage(imageSize, newFile, null);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("Unable to generate transparent image! Something is severely wrong!"); throw new RuntimeException("Unable to generate transparent image! Something is severely wrong!");
} }
} }
private static public static
File getErrorImage(int size) { File getErrorImage(int size) {
if (size == 0) { if (size == 0) {
// default size // default size
@ -83,8 +83,7 @@ class ImageResizeUtil {
File resizedFile = resizeFileNoCheck(size, imageStream); File resizedFile = resizeFileNoCheck(size, imageStream);
// now cache that file // now cache that file
File save = CacheUtil.save(cacheName, resizedFile); return CacheUtil.save(cacheName, resizedFile);
return save;
} catch (Exception e) { } catch (Exception e) {
// this must be thrown // this must be thrown
throw new RuntimeException("Serious problems! Unable to extract error image, this should NEVER happen!", e); throw new RuntimeException("Serious problems! Unable to extract error image, this should NEVER happen!", e);