mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Fixed wrong class package, pom config and broken code (visual studio code compatibility)
This commit is contained in:
parent
668ad3f69e
commit
3ca57533b5
10 changed files with 21 additions and 53 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue