forked from External/mage
Merge pull request #8751 from weirddan455/image-scaling
Remove dead image scaling library
This commit is contained in:
commit
daea494f41
2 changed files with 6 additions and 12 deletions
|
|
@ -63,13 +63,6 @@
|
|||
<version>0.9.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- image scaling for card images -->
|
||||
<!-- TODO: library is dead, must be replaced -->
|
||||
<groupId>com.mortennobel</groupId>
|
||||
<artifactId>java-image-scaling</artifactId>
|
||||
<version>0.8.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- graphic lib to draw GUI with effects -->
|
||||
<!-- TODO: library is dead, must be replaced -->
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package mage.client.util;
|
|||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import com.mortennobel.imagescaling.ResampleOp;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author user
|
||||
|
|
@ -95,9 +93,12 @@ public final class TransformedImageCache {
|
|||
}
|
||||
|
||||
private static BufferedImage resizeImage(BufferedImage original, int width, int height) {
|
||||
ResampleOp resampleOp = new ResampleOp(width, height);
|
||||
BufferedImage image = resampleOp.filter(original, null);
|
||||
return image;
|
||||
Image scaled = original.getScaledInstance(width, height, Image.SCALE_SMOOTH);
|
||||
BufferedImage output = new BufferedImage(width, height, original.getType());
|
||||
Graphics2D graphics = output.createGraphics();
|
||||
graphics.drawImage(scaled, 0, 0, null);
|
||||
graphics.dispose();
|
||||
return output;
|
||||
}
|
||||
|
||||
public static BufferedImage getResizedImage(BufferedImage image, int width, int height) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue