Fixed wrong class package, pom config and broken code (visual studio code compatibility)

This commit is contained in:
Oleg Agafonov 2019-04-03 02:45:52 +04:00
parent 668ad3f69e
commit 3ca57533b5
10 changed files with 21 additions and 53 deletions

View file

@ -72,16 +72,19 @@ public final class TransformedImageCache {
static {
// TODO: can we use a single map?
IMAGE_CACHE = ImageCaches.register(SoftValuesLoadingCache.from(
key -> SoftValuesLoadingCache.from(image -> {
if (key.width != image.getWidth() || key.height != image.getHeight()) {
image = resizeImage(image, key.width, key.height);
}
if (key.angle != 0.0) {
image = rotateImage(image, key.angle);
}
return image;
})));
IMAGE_CACHE = ImageCaches.register(SoftValuesLoadingCache.from(TransformedImageCache::createTransformedImageCache));
}
private static SoftValuesLoadingCache<BufferedImage, BufferedImage> createTransformedImageCache(Key key) {
return SoftValuesLoadingCache.from(image -> {
if (key.width != image.getWidth() || key.height != image.getHeight()) {
image = resizeImage(image, key.width, key.height);
}
if (key.angle != 0.0) {
image = rotateImage(image, key.angle);
}
return image;
});
}
private static BufferedImage rotateImage(BufferedImage image, double angle) {