mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
5372 add helper method for creating empty image list
This commit is contained in:
parent
3e13c3e4d2
commit
b0010f48d3
@ -348,12 +348,7 @@ class FileSearch {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0};
|
0};
|
||||||
List<Image> videoThumbnails = new ArrayList<>();
|
return new ThumbnailsWrapper(createDefaultThumbnailList(), framePositions, file);
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
return new ThumbnailsWrapper(videoThumbnails, framePositions, file);
|
|
||||||
}
|
}
|
||||||
if (tempFile.exists() == false || tempFile.length() < file.getSize()) {
|
if (tempFile.exists() == false || tempFile.length() < file.getSize()) {
|
||||||
ProgressHandle progress = ProgressHandle.createHandle(Bundle.FileSearch_genVideoThumb_progress_text(file.getName()));
|
ProgressHandle progress = ProgressHandle.createHandle(Bundle.FileSearch_genVideoThumb_progress_text(file.getName()));
|
||||||
@ -366,12 +361,7 @@ class FileSearch {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0};
|
0};
|
||||||
List<Image> videoThumbnails = new ArrayList<>();
|
return new ThumbnailsWrapper(createDefaultThumbnailList(), framePositions, file);
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
return new ThumbnailsWrapper(videoThumbnails, framePositions, file);
|
|
||||||
}
|
}
|
||||||
ContentUtils.writeToFile(file, tempFile, progress, null, true);
|
ContentUtils.writeToFile(file, tempFile, progress, null, true);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@ -391,12 +381,7 @@ class FileSearch {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0};
|
0};
|
||||||
List<Image> videoThumbnails = new ArrayList<>();
|
return new ThumbnailsWrapper(createDefaultThumbnailList(), framePositions, file);
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
return new ThumbnailsWrapper(videoThumbnails, framePositions, file);
|
|
||||||
}
|
}
|
||||||
double fps = videoFile.get(5); // gets frame per second
|
double fps = videoFile.get(5); // gets frame per second
|
||||||
double totalFrames = videoFile.get(7); // gets total frames
|
double totalFrames = videoFile.get(7); // gets total frames
|
||||||
@ -407,12 +392,7 @@ class FileSearch {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0};
|
0};
|
||||||
List<Image> videoThumbnails = new ArrayList<>();
|
return new ThumbnailsWrapper(createDefaultThumbnailList(), framePositions, file);
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
return new ThumbnailsWrapper(videoThumbnails, framePositions, file);
|
|
||||||
}
|
}
|
||||||
if (Thread.interrupted()) {
|
if (Thread.interrupted()) {
|
||||||
int[] framePositions = new int[]{
|
int[] framePositions = new int[]{
|
||||||
@ -420,12 +400,7 @@ class FileSearch {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0};
|
0};
|
||||||
List<Image> videoThumbnails = new ArrayList<>();
|
return new ThumbnailsWrapper(createDefaultThumbnailList(), framePositions, file);
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
|
||||||
return new ThumbnailsWrapper(videoThumbnails, framePositions, file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double duration = 1000 * (totalFrames / fps); //total milliseconds
|
double duration = 1000 * (totalFrames / fps); //total milliseconds
|
||||||
@ -502,6 +477,21 @@ class FileSearch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private helper method for creating video thumbnails, for use when no
|
||||||
|
* thumbnails are created.
|
||||||
|
*
|
||||||
|
* @return List containing the default thumbnail.s
|
||||||
|
*/
|
||||||
|
private static List<Image> createDefaultThumbnailList() {
|
||||||
|
List<Image> videoThumbnails = new ArrayList<>();
|
||||||
|
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
||||||
|
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
||||||
|
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
||||||
|
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
||||||
|
return videoThumbnails;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the cache used to store search results by group.
|
* Clear the cache used to store search results by group.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user