mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
fixed bug where images could not be resized and exceptions occured
This commit is contained in:
parent
2bc314d79f
commit
ce306636a5
@ -144,6 +144,10 @@ public class MediaViewImagePanel extends javax.swing.JPanel {
|
||||
try {
|
||||
//original input stream
|
||||
BufferedImage bi = ImageIO.read(inputStream);
|
||||
if (bi == null) {
|
||||
logger.log(Level.WARNING, "Could image reader not found for file: " + fileName);
|
||||
return;
|
||||
}
|
||||
//scale image using Scalr
|
||||
BufferedImage biScaled = ScalrWrapper.resizeHighQuality(bi, (int) dims.getWidth(), (int) dims.getHeight());
|
||||
//convert from awt imageto fx image
|
||||
|
@ -86,6 +86,9 @@ class ThumbnailViewNode extends FilterNode {
|
||||
if (getFile(content.getId()).exists()) {
|
||||
try {
|
||||
icon = ImageIO.read(getFile(content.getId()));
|
||||
if (icon == null) {
|
||||
icon = ThumbnailViewNode.defaultIcon;
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
icon = ThumbnailViewNode.defaultIcon;
|
||||
}
|
||||
@ -120,6 +123,10 @@ class ThumbnailViewNode extends FilterNode {
|
||||
try {
|
||||
inputStream = new ReadContentInputStream(content);
|
||||
BufferedImage bi = ImageIO.read(inputStream);
|
||||
if (bi == null) {
|
||||
logger.log(Level.WARNING, "No image reader for file: " + content.getName());
|
||||
return null;
|
||||
}
|
||||
BufferedImage biScaled = ScalrWrapper.resizeFast(bi, 100, 100);
|
||||
return biScaled;
|
||||
}catch (OutOfMemoryError e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user