diff --git a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ImageAnalyzerController.java b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ImageAnalyzerController.java
index 099ad4fbd1..f65fe67429 100644
--- a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ImageAnalyzerController.java
+++ b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ImageAnalyzerController.java
@@ -190,7 +190,9 @@ public final class ImageAnalyzerController {
});
groupManager.getAnalyzedGroups().addListener((Observable o) -> {
- checkForGroups();
+ if(Case.isCaseOpen()){
+ checkForGroups();
+ }
});
groupManager.getUnSeenGroups().addListener((Observable observable) -> {
diff --git a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ImageAnalyzerTopComponent.java b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ImageAnalyzerTopComponent.java
index 028605ea3b..bd72f11370 100644
--- a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ImageAnalyzerTopComponent.java
+++ b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ImageAnalyzerTopComponent.java
@@ -34,6 +34,7 @@ import org.openide.util.NbBundle.Messages;
import org.openide.windows.Mode;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;
+import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.imageanalyzer.gui.GroupPane;
import org.sleuthkit.autopsy.imageanalyzer.gui.MetaDataPane;
@@ -67,6 +68,7 @@ public final class ImageAnalyzerTopComponent extends TopComponent implements Exp
public final static String PREFERRED_ID = "ImageAnalyzerTopComponent";
private static final Logger LOGGER = Logger.getLogger(ImageAnalyzerTopComponent.class.getName());
+ private static boolean topComponentInitialized = false;
public static void openTopComponent() {
//TODO:eventually move to this model, throwing away everything and rebuilding controller groupmanager etc for each case.
@@ -79,6 +81,7 @@ public final class ImageAnalyzerTopComponent extends TopComponent implements Exp
// timeLineController.openTimeLine();
final ImageAnalyzerTopComponent tc = (ImageAnalyzerTopComponent) WindowManager.getDefault().findTopComponent("ImageAnalyzerTopComponent");
if (tc != null) {
+ topComponentInitialized = true;
WindowManager.getDefault().isTopComponentFloating(tc);
Mode mode = WindowManager.getDefault().findMode("timeline");
if (mode != null) {
@@ -90,12 +93,14 @@ public final class ImageAnalyzerTopComponent extends TopComponent implements Exp
}
public static void closeTopComponent() {
- final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageAnalyzerTopComponent");
- if (etc != null) {
- try {
- etc.close();
- } catch (Exception e) {
- LOGGER.log(Level.SEVERE, "failed to close ImageAnalyzerTopComponent", e);
+ if(topComponentInitialized){
+ final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageAnalyzerTopComponent");
+ if (etc != null) {
+ try {
+ etc.close();
+ } catch (Exception e) {
+ LOGGER.log(Level.SEVERE, "failed to close ImageAnalyzerTopComponent", e);
+ }
}
}
}
@@ -128,7 +133,7 @@ public final class ImageAnalyzerTopComponent extends TopComponent implements Exp
setName(Bundle.CTL_ImageAnalyzerTopComponent());
setToolTipText(Bundle.HINT_ImageAnalyzerTopComponent());
-
+
initComponents();
Platform.runLater(() -> {//initialize jfx ui
diff --git a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ThumbnailCache.java b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ThumbnailCache.java
index 66b2b7e337..22f3b42275 100644
--- a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ThumbnailCache.java
+++ b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/ThumbnailCache.java
@@ -162,7 +162,11 @@ public enum ThumbnailCache {
try (InputStream inputStream = new BufferedInputStream(new ReadContentInputStream(file.getAbstractFile()))) {
final Image thumbnail = new Image(inputStream, MAX_ICON_SIZE, MAX_ICON_SIZE, true, true);
if (thumbnail.isError()) { //if there was an error loading the image via JFX, fall back on Swing
- LOGGER.log(Level.WARNING, "problem loading image: " + file.getName() + " .", thumbnail.getException());
+ LOGGER.log(Level.WARNING, "problem loading thumbnail for image: " + file.getName() + " .");
+ // Doing it this way puts the whole stack trace in the console output, which is probably not
+ // needed. There are a significant number of cases where this is expected to fail (bitmaps,
+ // empty files, etc.)
+ //LOGGER.log(Level.WARNING, "problem loading image: " + file.getName() + " .", thumbnail.getException());
return fallbackToSwingImage(file);
} else { //if the load went successfully, save the thumbnail to disk on a background thread
imageSaver.execute(() -> {
diff --git a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/grouping/GroupManager.java b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/grouping/GroupManager.java
index 31fc425b82..e86d9c1fd0 100644
--- a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/grouping/GroupManager.java
+++ b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/grouping/GroupManager.java
@@ -618,6 +618,11 @@ public class GroupManager implements FileUpdateEvent.FileUpdateListener {
* @param force true to force a full db query regroup
*/
public > void regroup(final DrawableAttribute groupBy, final GroupSortBy sortBy, final SortOrder sortOrder, Boolean force) {
+
+ if(! Case.isCaseOpen()){
+ return;
+ }
+
//only re-query the db if the group by attribute changed or it is forced
if (groupBy != getGroupBy() || force == true) {
setGroupBy(groupBy);