mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 02:07:42 +00:00
5423 preserve ordering of image thumbnails
This commit is contained in:
parent
55449875af
commit
8722f847b3
@ -19,6 +19,7 @@
|
||||
package org.sleuthkit.autopsy.filequery;
|
||||
|
||||
import java.awt.Image;
|
||||
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -26,14 +27,19 @@ import java.awt.Image;
|
||||
*/
|
||||
public class ImageThumbnailWrapper {
|
||||
|
||||
private final Image thumbnail;
|
||||
private Image thumbnail;
|
||||
private final ResultFile resultFile;
|
||||
|
||||
ImageThumbnailWrapper(Image thumbnail, ResultFile file) {
|
||||
this.thumbnail = thumbnail;
|
||||
|
||||
ImageThumbnailWrapper(ResultFile file) {
|
||||
this.thumbnail = ImageUtils.getDefaultThumbnail();
|
||||
this.resultFile = file;
|
||||
}
|
||||
|
||||
void setImageThumbnail(Image thumbnail){
|
||||
this.thumbnail = thumbnail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ResultFile which represents the image file which the thumbnail
|
||||
* was created for.
|
||||
|
@ -529,34 +529,39 @@ public class ResultsPanel extends javax.swing.JPanel {
|
||||
@Override
|
||||
protected Void doInBackground() throws Exception {
|
||||
FileSearch.getVideoThumbnails(thumbnailWrapper);
|
||||
videoThumbnailViewer.repaint();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private class ImageThumbnailWorker extends SwingWorker<Void, Void> {
|
||||
|
||||
private final ResultFile file;
|
||||
private ImageThumbnailWrapper thumbnailWrapper;
|
||||
|
||||
ImageThumbnailWorker(ResultFile file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground() throws Exception {
|
||||
Image thumbnail = ImageUtils.getThumbnail(file.getFirstInstance(), ImageUtils.ICON_SIZE_LARGE);
|
||||
if (thumbnail == null) {
|
||||
thumbnail = ImageUtils.getDefaultThumbnail();
|
||||
}
|
||||
thumbnailWrapper = new ImageThumbnailWrapper(thumbnail, file);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
if (!isCancelled()) {
|
||||
imageThumbnailViewer.addFile(thumbnailWrapper);
|
||||
videoThumbnailViewer.repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ImageThumbnailWorker extends SwingWorker<Void, Void> {
|
||||
|
||||
private ImageThumbnailWrapper thumbnailWrapper;
|
||||
|
||||
ImageThumbnailWorker(ResultFile file) {
|
||||
thumbnailWrapper = new ImageThumbnailWrapper(file);
|
||||
imageThumbnailViewer.addFile(thumbnailWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground() throws Exception {
|
||||
Image thumbnail = ImageUtils.getThumbnail(thumbnailWrapper.getResultFile().getFirstInstance(), ImageUtils.ICON_SIZE_LARGE);
|
||||
if (thumbnail != null) {
|
||||
thumbnailWrapper.setImageThumbnail(thumbnail);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
if (!isCancelled()) {
|
||||
imageThumbnailViewer.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user