Skip to content

Commit

Permalink
change deprecated stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
java-coding-prodigy committed Sep 24, 2023
1 parent 9314531 commit e83998a
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

import javax.imageio.ImageIO;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
Expand All @@ -16,7 +14,8 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -66,10 +65,10 @@ static BufferedImage renderSubPod(SubPod subPod) {
Graphics graphics = destinationImage.getGraphics();

try {
graphics.drawImage(ImageIO.read(new URL(sourceImage.getSource())), IMAGE_MARGIN_PX,
IMAGE_MARGIN_PX, null);
} catch (IOException e) {
throw new UncheckedIOException(e);
graphics.drawImage(ImageIO.read(new URI(sourceImage.getSource()).toURL()),
IMAGE_MARGIN_PX, IMAGE_MARGIN_PX, null);
} catch (IOException | URISyntaxException e) {
throw new RuntimeException(e);
}

return destinationImage;
Expand Down

0 comments on commit e83998a

Please sign in to comment.