diff --git a/images/src/org/intellij/images/index/ImageInfoIndex.java b/images/src/org/intellij/images/index/ImageInfoIndex.java index c92a0ccc71a0..b87e58a0906e 100644 --- a/images/src/org/intellij/images/index/ImageInfoIndex.java +++ b/images/src/org/intellij/images/index/ImageInfoIndex.java @@ -62,7 +62,16 @@ public class ImageInfoIndex extends SingleEntryFileBasedIndexExtension myDataIndexer = new SingleEntryIndexer(false) { @Override protected ImageInfo computeValue(@NotNull FileContent inputData) { - final ImageInfoReader.Info info = ImageInfoReader.getInfo(inputData.getFile().getPath()); + VirtualFile file = inputData.getFile(); + final ImageInfoReader.Info info; + if (file.getFileSystem() == TempFileSystem.getInstance()) { // for tests load content directly as we are now not requiring content index + try { + info = ImageInfoReader.getInfo(file.contentsToByteArray()); + } catch (IOException ex) { return null; } + } + else { + info = ImageInfoReader.getInfo(file.getPath()); + } return info != null? new ImageInfo(info.width, info.height, info.bpp) : null; } };