From dad43a2cd7e49b49cb61fbe376b0302fb7d7271a Mon Sep 17 00:00:00 2001 From: sita Date: Thu, 13 Feb 2020 10:04:44 +0100 Subject: [PATCH] serialization/deserialization of ICF state, UI fixes, more classes are final --- docs/index.html | 14 ++--- docs/ss.css | 6 +- src/main/java/XIS/WindowStart.java | 2 +- .../java/XIS/sections/GlobalSettings.java | 6 +- .../XIS/sections/compression/compression.fxml | 4 +- .../imagecopyfinder/ComparableImageIO.java | 2 +- .../imagecopyfinder/ComparedImagePair.java | 4 +- .../sections/imagecopyfinder/GroupedFile.java | 2 +- .../imagecopyfinder/GroupedFolder.java | 2 +- .../imagecopyfinder/GroupedFoldersParser.java | 2 +- .../ImageCopyFinderModuleVista.java | 29 ++++++++-- .../imagecopyfinder/ParsingException.java | 2 +- .../imagecopyfinder/SerializableIcfState.java | 56 +++++++++++++++++++ .../view1settings/View1Controller.java | 44 ++++++++++++++- .../imagecopyfinder/view1settings/view1.fxml | 2 + .../view2comparison/View2Controller.java | 15 ++++- 16 files changed, 164 insertions(+), 28 deletions(-) create mode 100644 src/main/java/XIS/sections/imagecopyfinder/SerializableIcfState.java diff --git a/docs/index.html b/docs/index.html index 83fef7f..2da1cee 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,13 +20,13 @@

Modules:

Image copy finder

Description:

Image copy finder attempts to find copies of images in folders selected by the user. After initial scan - should any pairs of similar-looking images be found, they are displayed to the user, who can decide - to move one of them into user-selected "delete" folder or ignore that pair. + if any pairs of similar-looking images are found, they are displayed to the user. User can then decide for each pair + to move one of the images into user-selected "delete" folder or ignore that pair.

Important tip:

If you compare a large amount of images it might not only take a long time, but also a lot of memory space. - The application won't crash, but the thread that compares images will be probably killed, resulting in no progress + The application might not crash, but the thread that compares images will be probably killed, resulting in no progress at all. If you fear that it might happen, select lower size of compared image (for example less than 64) @@ -98,14 +98,14 @@

How it works:

they are added as a pair to list containing similar images. - After completing those two phases list of images is displayed to the user. + After completing those two phases list of pairs of images is displayed to the user.
-

Scanprocessing

+

Scan-processing

Description:

- This module contains filters created to make printing scanned or photographed text or pictures clearer. + This module contains filters created to make printed images cleaner, no matter whether they come from image or from presentation, or from a book. Filters can be used on either a single image or on .pdf file.

Currently there are two modules: high-pass-filter and quantization.
High pass filter works by dividing the original image by the blurred version of it.
@@ -129,7 +129,7 @@

Image compression

Description:

Image compression uses my custom lossy compression algorithm to compress images. It uses a combination of chroma subsampling, dictionary compression and RLE compression. Additional improvements are planned.
- Do not use it for serious storage currently - it is too slow and sometimes the files are damaged + Do not use it for serious storage currently - it is too slow and sometimes the files are damaged

File structure:

Best way to describe algorithm is to describe its file structure (somewhat outdated currently):
    diff --git a/docs/ss.css b/docs/ss.css index cc1461c..47fe9ca 100644 --- a/docs/ss.css +++ b/docs/ss.css @@ -1,3 +1,7 @@ +strong, b { + font-weight: bold; +} + body { background-color: rgb(248, 248, 248); max-width: 700px; @@ -24,4 +28,4 @@ p, h1, h2, h3, h4 { div { font-weight: lighter; color: rgb(32, 32, 32); -} \ No newline at end of file +} diff --git a/src/main/java/XIS/WindowStart.java b/src/main/java/XIS/WindowStart.java index 1e60a65..5dbb322 100644 --- a/src/main/java/XIS/WindowStart.java +++ b/src/main/java/XIS/WindowStart.java @@ -19,7 +19,7 @@ public void start(Stage stage) throws Exception{ var res = getClass().getResource("main/mainView.fxml"); Parent root = FXMLLoader.load(res); - stage.setTitle("XIS 0.4.1"); + stage.setTitle("XIS 0.5.0"); stage.setScene(new Scene (root, 1280, 800)); stage.setMinHeight(480); stage.setMinWidth(800); diff --git a/src/main/java/XIS/sections/GlobalSettings.java b/src/main/java/XIS/sections/GlobalSettings.java index ba336e8..24e93a2 100644 --- a/src/main/java/XIS/sections/GlobalSettings.java +++ b/src/main/java/XIS/sections/GlobalSettings.java @@ -7,16 +7,16 @@ public class GlobalSettings { private static GlobalSettings globalSettingsInstance; - private int maxThreads = Integer.MAX_VALUE; - public GlobalSettings() { } private int availableProcessors = -1; + public int getNormalizedThreadCount() { if (availableProcessors == -1) { - availableProcessors = Math.max(Math.min(Runtime.getRuntime().availableProcessors(), maxThreads), 1); + final int MAX_THREADS = Integer.MAX_VALUE; + availableProcessors = Math.max(Math.min(Runtime.getRuntime().availableProcessors(), MAX_THREADS), 1); } return availableProcessors; } diff --git a/src/main/java/XIS/sections/compression/compression.fxml b/src/main/java/XIS/sections/compression/compression.fxml index e394033..bc5d4d8 100644 --- a/src/main/java/XIS/sections/compression/compression.fxml +++ b/src/main/java/XIS/sections/compression/compression.fxml @@ -9,7 +9,7 @@