Repository: qarmin/czkawka (language: rust)

Issue:
Images from reference folders being compared to each other
Might be getting something wrong here but why are images from reference folders being compared to each other? As I understand it when selecting reference folder, all other non reference folder images are compared with one another and with the ones from reference folders. But the case is that even images in the reference folder are being compared with each other for no reason. If the point is to delete files from specific destination that can be achieved by custom select, thus making reference option unnecessary and just slows things down. In my specific case there is main dataset with ~500k images and if want to check folder with 100 images for possible duplicates before adding to the main dataset, the program compares images within reference folder making the whole process way longer than is actually needed. Again, might be wrong about this and just picked wrong options, but if not it really should be fixed.


Discussion / hints:
This is not a bug, but sub-optimal algorithm.

Due to simplicity of adding at the end of functions ~40 lines of code I used this solution.

For duplicate mode I don't think that this is needed to modify algorithm since hashes are cached and comparing them is quite cheap.
In similar image tool, comparing images with bigger amount of files may be slow, so in this situation early check for reference folders could be implemented
Do you mean that each added folder is being treated as one? I think this is the way I prefer it to work.
Just my opinion but e.g. if there are 3 folders added [a b c] and [a] is checked as reference then files within folder [a] should only be compared with the ones in folders [b] and [c] and not with each other. Files in [b] and [c] are all compared individually (each file is compared to every other in [a] [b] and [c]). Same system that's implemented in https://github.com/arsenetar/dupeguru/. Many use cases for that, one of which I already mentioned; if I have 10 images and want to see if there are any similar images in a folder containing 10000, program should just compare these 10 images with the 10000, and not additionally compare every image in the 10000 set with each other. Not only is it unnecessary but also greatly increases processing time. Reference folder feature as it is implemented now is not needed really because you can already select custom path with custom select. 
All of the above is in regards to similar image option; similar files where hashes are compared have the same problem, but the processing time is way smaller so it's not that bad.

Fix patch:
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 653706e0c..206fc8f73 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -12,7 +12,7 @@ jobs:
   linux-default:
     strategy:
       matrix:
-        toolchain: [ stable, 1.60.0 ]
+        toolchain: [ stable, 1.62.0 ]
         type: [ release ]
     runs-on: ubuntu-22.04
     steps:
@@ -39,7 +39,7 @@ jobs:
         env:
           CARGO_INCREMENTAL: 0
           RUSTFLAGS: "-C debuginfo=0"
-        if: ${{ (matrix.type == 'release') && (matrix.toolchain == '1.60.0') }}
+        if: ${{ (matrix.type == 'release') && (matrix.toolchain == '1.62.0') }}
 
       - name: Build Release
         run: cargo build --release
diff --git a/Cargo.lock b/Cargo.lock
index c5bd6dcef..492e50a1f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -59,9 +59,9 @@ dependencies = [
 
 [[package]]
 name = "aho-corasick"
-version = "0.7.18"
+version = "0.7.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
+checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e"
 dependencies = [
  "memchr",
 ]
@@ -77,9 +77,9 @@ dependencies = [
 
 [[package]]
 name = "anyhow"
-version = "1.0.62"
+version = "1.0.65"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305"
+checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602"
 
 [[package]]
 name = "arrayref"
@@ -199,9 +199,9 @@ dependencies = [
 
 [[package]]
 name = "block-buffer"
-version = "0.10.2"
+version = "0.10.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324"
+checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e"
 dependencies = [
  "generic-array",
 ]
@@ -352,9 +352,9 @@ dependencies = [
 
 [[package]]
 name = "clap"
-version = "3.2.18"
+version = "3.2.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b15f2ea93df33549dbe2e8eecd1ca55269d63ae0b3ba1f55db030817d1c2867f"
+checksum = "1ed5341b2301a26ab80be5cbdced622e80ed808483c52e45e3310a877d3b37d7"
 dependencies = [
  "atty",
  "bitflags",
@@ -409,9 +409,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
 
 [[package]]
 name = "cpufeatures"
-version = "0.2.4"
+version = "0.2.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813"
+checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
 dependencies = [
  "libc",
 ]
@@ -557,13 +557,14 @@ dependencies = [
 
 [[package]]
 name = "dashmap"
-version = "5.3.4"
+version = "5.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3495912c9c1ccf2e18976439f4443f3fee0fd61f424ff99fde6a66b15ecb448f"
+checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc"
 dependencies = [
  "cfg-if",
  "hashbrown",
  "lock_api",
+ "once_cell",
  "parking_lot_core",
 ]
 
@@ -576,15 +577,6 @@ dependencies = [
  "adler32",
 ]
 
-[[package]]
-name = "deflate"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f"
-dependencies = [
- "adler32",
-]
-
 [[package]]
 name = "digest"
 version = "0.9.0"
@@ -600,7 +592,7 @@ version = "0.10.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506"
 dependencies = [
- "block-buffer 0.10.2",
+ "block-buffer 0.10.3",
  "crypto-common",
  "subtle",
 ]
@@ -810,11 +802,10 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
 
 [[package]]
 name = "form_urlencoded"
-version = "1.0.1"
+version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
+checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8"
 dependencies = [
- "matches",
  "percent-encoding",
 ]
 
@@ -1253,9 +1244,12 @@ dependencies = [
 
 [[package]]
 name = "humansize"
-version = "1.1.1"
+version = "2.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026"
+checksum = "8e12090e3b87a266157c30eef7ee8f430f4226feb8dd970cccea2cc67f52f70e"
+dependencies = [
+ "libm",
+]
 
 [[package]]
 name = "i18n-config"
@@ -1328,9 +1322,9 @@ dependencies = [
 
 [[package]]
 name = "iana-time-zone"
-version = "0.1.47"
+version = "0.1.48"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c495f162af0bf17656d0014a0eded5f3cd2f365fdd204548c2869db89359dc7"
+checksum = "237a0714f28b1ee39ccec0770ccb544eb02c9ef2c82bb096230eefcffa6468b0"
 dependencies = [
  "android_system_properties",
  "core-foundation-sys",
@@ -1342,11 +1336,10 @@ dependencies = [
 
 [[package]]
 name = "idna"
-version = "0.2.3"
+version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
+checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
 dependencies = [
- "matches",
  "unicode-bidi",
  "unicode-normalization",
 ]
@@ -1462,9 +1455,9 @@ dependencies = [
 
 [[package]]
 name = "itertools"
-version = "0.10.3"
+version = "0.10.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
+checksum = "d8bf247779e67a9082a4790b45e71ac7cfd1321331a5c856a74a9faebdab78d0"
 dependencies = [
  "either",
 ]
@@ -1492,9 +1485,9 @@ dependencies = [
 
 [[package]]
 name = "js-sys"
-version = "0.3.59"
+version = "0.3.60"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2"
+checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
 dependencies = [
  "wasm-bindgen",
 ]
@@ -1536,6 +1529,12 @@ dependencies = [
  "libc",
 ]
 
+[[package]]
+name = "libm"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565"
+
 [[package]]
 name = "linked-hash-map"
 version = "0.5.6"
@@ -1567,9 +1566,9 @@ dependencies = [
 
 [[package]]
 name = "lofty"
-version = "0.8.0"
+version = "0.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29fa9dc7a42e1a9025c7514630f6b70418ef7446028ed30d8afe8ed2e80ebf19"
+checksum = "863330a778316906983c07e225026b643b170502a96709dbfe6e6168bce53084"
 dependencies = [
  "base64 0.13.0",
  "byteorder",
@@ -1610,12 +1609,6 @@ dependencies = [
  "libc",
 ]
 
-[[package]]
-name = "matches"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
-
 [[package]]
 name = "md5"
 version = "0.7.0"
@@ -1655,9 +1648,9 @@ dependencies = [
 
 [[package]]
 name = "miniz_oxide"
-version = "0.5.3"
+version = "0.5.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
+checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34"
 dependencies = [
  "adler",
 ]
@@ -1778,9 +1771,9 @@ dependencies = [
 
 [[package]]
 name = "once_cell"
-version = "1.13.1"
+version = "1.14.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e"
+checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0"
 
 [[package]]
 name = "opaque-debug"
@@ -1871,9 +1864,9 @@ dependencies = [
 
 [[package]]
 name = "paste"
-version = "1.0.8"
+version = "1.0.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22"
+checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1"
 
 [[package]]
 name = "pathdiff"
@@ -1890,7 +1883,7 @@ dependencies = [
  "digest 0.10.3",
  "hmac",
  "password-hash",
- "sha2 0.10.3",
+ "sha2 0.10.5",
 ]
 
 [[package]]
@@ -1903,7 +1896,7 @@ dependencies = [
  "block-modes",
  "byteorder",
  "chrono",
- "deflate 0.9.1",
+ "deflate",
  "fax",
  "glob",
  "inflate",
@@ -1934,15 +1927,15 @@ dependencies = [
 
 [[package]]
 name = "percent-encoding"
-version = "2.1.0"
+version = "2.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
+checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
 
 [[package]]
 name = "pest"
-version = "2.3.0"
+version = "2.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4"
+checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048"
 dependencies = [
  "thiserror",
  "ucd-trie",
@@ -1988,13 +1981,13 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
 
 [[package]]
 name = "png"
-version = "0.17.5"
+version = "0.17.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba"
+checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c"
 dependencies = [
  "bitflags",
  "crc32fast",
- "deflate 1.0.0",
+ "flate2",
  "miniz_oxide",
 ]
 
@@ -2192,9 +2185,9 @@ dependencies = [
 
 [[package]]
 name = "rust-embed"
-version = "6.4.0"
+version = "6.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a17e5ac65b318f397182ae94e532da0ba56b88dd1200b774715d36c4943b1c3"
+checksum = "e26934cd67a1da1165efe61cba4047cc1b4a526019da609fcce13a1000afb5fa"
 dependencies = [
  "rust-embed-impl",
  "rust-embed-utils",
@@ -2203,9 +2196,9 @@ dependencies = [
 
 [[package]]
 name = "rust-embed-impl"
-version = "6.2.0"
+version = "6.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94e763e24ba2bf0c72bc6be883f967f794a019fafd1b86ba1daff9c91a7edd30"
+checksum = "e35d7b402e273544cc08e0824aa3404333fab8a90ac43589d3d5b72f4b346e12"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -2216,11 +2209,11 @@ dependencies = [
 
 [[package]]
 name = "rust-embed-utils"
-version = "7.2.0"
+version = "7.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "756feca3afcbb1487a1d01f4ecd94cf8ec98ea074c55a69e7136d29fb6166029"
+checksum = "c1669d81dfabd1b5f8e2856b8bbe146c6192b0ba22162edc738ac0a5de18f054"
 dependencies = [
- "sha2 0.9.9",
+ "sha2 0.10.5",
  "walkdir",
 ]
 
@@ -2395,9 +2388,9 @@ dependencies = [
 
 [[package]]
 name = "sha1"
-version = "0.10.2"
+version = "0.10.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cf2781a4ca844dd4f9b608a1791eea19830df0ad3cdd9988cd05f1c66ccb63a"
+checksum = "006769ba83e921b3085caa8334186b00cf92b4cb1a6cf4632fbccc8eff5c7549"
 dependencies = [
  "cfg-if",
  "cpufeatures",
@@ -2419,9 +2412,9 @@ dependencies = [
 
 [[package]]
 name = "sha2"
-version = "0.10.3"
+version = "0.10.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215"
+checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5"
 dependencies = [
  "cfg-if",
  "cpufeatures",
@@ -2728,18 +2721,18 @@ checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
 
 [[package]]
 name = "thiserror"
-version = "1.0.32"
+version = "1.0.35"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994"
+checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85"
 dependencies = [
  "thiserror-impl",
 ]
 
 [[package]]
 name = "thiserror-impl"
-version = "1.0.32"
+version = "1.0.35"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21"
+checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -2874,9 +2867,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
 
 [[package]]
 name = "ucd-trie"
-version = "0.1.4"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c"
+checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81"
 
 [[package]]
 name = "unic-langid"
@@ -2929,13 +2922,12 @@ dependencies = [
 
 [[package]]
 name = "url"
-version = "2.2.2"
+version = "2.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
+checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
 dependencies = [
  "form_urlencoded",
  "idna",
- "matches",
  "percent-encoding",
 ]
 
@@ -2999,9 +2991,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 
 [[package]]
 name = "wasm-bindgen"
-version = "0.2.82"
+version = "0.2.83"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d"
+checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
 dependencies = [
  "cfg-if",
  "wasm-bindgen-macro",
@@ -3009,9 +3001,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-backend"
-version = "0.2.82"
+version = "0.2.83"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f"
+checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
 dependencies = [
  "bumpalo",
  "log",
@@ -3024,9 +3016,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro"
-version = "0.2.82"
+version = "0.2.83"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602"
+checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
 dependencies = [
  "quote",
  "wasm-bindgen-macro-support",
@@ -3034,9 +3026,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro-support"
-version = "0.2.82"
+version = "0.2.83"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
+checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -3047,9 +3039,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-shared"
-version = "0.2.82"
+version = "0.2.83"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
+checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
 
 [[package]]
 name = "weezl"
diff --git a/czkawka_cli/Cargo.toml b/czkawka_cli/Cargo.toml
index 60ec2e819..8aed282e4 100644
--- a/czkawka_cli/Cargo.toml
+++ b/czkawka_cli/Cargo.toml
@@ -3,14 +3,14 @@ name = "czkawka_cli"
 version = "5.0.2"
 authors = ["Rafał Mikrut <mikrutrafal@protonmail.com>"]
 edition = "2021"
-rust-version = "1.60"
+rust-version = "1.62"
 description = "CLI frontend of Czkawka"
 license = "MIT"
 homepage = "https://github.com/qarmin/czkawka"
 repository = "https://github.com/qarmin/czkawka"
 
 [dependencies]
-clap = { version = "3.2.17", features = ["derive"] }
+clap = { version = "3.2.21", features = ["derive"] }
 
 # For enum types
 image_hasher = "1.0.0"
diff --git a/czkawka_core/Cargo.toml b/czkawka_core/Cargo.toml
index b827adf4f..2eb662cd8 100644
--- a/czkawka_core/Cargo.toml
+++ b/czkawka_core/Cargo.toml
@@ -3,7 +3,7 @@ name = "czkawka_core"
 version = "5.0.2"
 authors = ["Rafał Mikrut <mikrutrafal@protonmail.com>"]
 edition = "2021"
-rust-version = "1.60"
+rust-version = "1.62"
 description = "Core of Czkawka app"
 license = "MIT"
 homepage = "https://github.com/qarmin/czkawka"
@@ -11,7 +11,7 @@ repository = "https://github.com/qarmin/czkawka"
 
 
 [dependencies]
-humansize = "1.1.1"
+humansize = "2.0.0"
 rayon = "1.5.3"
 crossbeam-channel = "0.5.6"
 
@@ -26,10 +26,10 @@ hamming = "0.1.3"
 
 # Needed by same music
 bitflags = "1.3.2"
-lofty = "0.8.0"
+lofty = "0.8.1"
 
 # Futures - needed by async progress sender
-futures = "0.3.23"
+futures = "0.3.24"
 
 # Needed by broken files
 zip = { version = "0.6.2", features = ["aes-crypto", "bzip2", "deflate", "time"], default-features = false }
@@ -48,15 +48,15 @@ vid_dup_finder_lib = "0.1.1"
 ffmpeg_cmdline_utils = "0.1.2"
 
 # Saving/Loading Cache
-serde = "1.0.143"
+serde = "1.0.144"
 bincode = "1.3.3"
-serde_json = "1.0.83"
+serde_json = "1.0.85"
 
 # Language
 i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] }
 i18n-embed-fl = "0.6.4"
-rust-embed = "6.4.0"
-once_cell = "1.13.1"
+rust-embed = "6.4.1"
+once_cell = "1.14.0"
 
 # Raw image files
 rawloader = "0.37.1"
@@ -70,7 +70,7 @@ num_cpus = "1.13.1"
 
 # Heif/Heic
 libheif-rs = { version = "0.15.0", optional = true }
-anyhow = { version = "1.0.62", optional = true }
+anyhow = { version = "1.0.65", optional = true }
 
 [features]
 default = []
diff --git a/czkawka_core/src/big_file.rs b/czkawka_core/src/big_file.rs
index 26b24a61b..50000436f 100644
--- a/czkawka_core/src/big_file.rs
+++ b/czkawka_core/src/big_file.rs
@@ -11,7 +11,8 @@ use std::time::{SystemTime, UNIX_EPOCH};
 use std::{fs, thread};
 
 use crossbeam_channel::Receiver;
-use humansize::{file_size_opts as options, FileSize};
+use humansize::format_size;
+use humansize::BINARY;
 use rayon::prelude::*;
 
 use crate::common::split_path;
@@ -470,7 +471,7 @@ impl SaveResults for BigFile {
                 write!(writer, "{} the smallest files.\n\n", self.information.number_of_real_files).unwrap();
             }
             for (size, file_entry) in self.big_files.iter() {
-                writeln!(writer, "{} ({}) - {}", size.file_size(options::BINARY).unwrap(), size, file_entry.path.display()).unwrap();
+                writeln!(writer, "{} ({}) - {}", format_size(*size, BINARY), size, file_entry.path.display()).unwrap();
             }
         } else {
             write!(writer, "Not found any files.").unwrap();
@@ -489,7 +490,7 @@ impl PrintResults for BigFile {
             println!("{} the smallest files.\n\n", self.information.number_of_real_files);
         }
         for (size, file_entry) in self.big_files.iter() {
-            println!("{} ({}) - {}", size.file_size(options::BINARY).unwrap(), size, file_entry.path.display());
+            println!("{} ({}) - {}", format_size(*size, BINARY), size, file_entry.path.display());
         }
         Common::print_time(start_time, SystemTime::now(), "print_entries".to_string());
     }
diff --git a/czkawka_core/src/duplicate.rs b/czkawka_core/src/duplicate.rs
index 169e3bbe2..7d81f158d 100644
--- a/czkawka_core/src/duplicate.rs
+++ b/czkawka_core/src/duplicate.rs
@@ -16,7 +16,8 @@ use std::time::{Duration, SystemTime};
 use std::{fs, mem, thread};
 
 use crossbeam_channel::Receiver;
-use humansize::{file_size_opts as options, FileSize};
+use humansize::format_size;
+use humansize::BINARY;
 use rayon::prelude::*;
 
 use crate::common::{open_cache_folder, Common, LOOP_DURATION};
@@ -965,12 +966,12 @@ impl DebugPrint for DuplicateFinder {
         );
         println!(
             "Lost space by size - {} ({} bytes)",
-            self.information.lost_space_by_size.file_size(options::BINARY).unwrap(),
+            format_size(self.information.lost_space_by_size, BINARY),
             self.information.lost_space_by_size
         );
         println!(
             "Lost space by hash - {} ({} bytes)",
-            self.information.lost_space_by_hash.file_size(options::BINARY).unwrap(),
+            format_size(self.information.lost_space_by_hash, BINARY),
             self.information.lost_space_by_hash
         );
 
@@ -1053,11 +1054,11 @@ impl SaveResults for DuplicateFinder {
                         "Found {} duplicated files which in {} groups which takes {}.",
                         self.information.number_of_duplicated_files_by_size,
                         self.information.number_of_groups_by_size,
-                        self.information.lost_space_by_size.file_size(options::BINARY).unwrap()
+                        format_size(self.information.lost_space_by_size, BINARY)
                     )
                     .unwrap();
                     for (size, vector) in self.files_with_identical_size.iter().rev() {
-                        write!(writer, "\n---- Size {} ({}) - {} files \n", size.file_size(options::BINARY).unwrap(), size, vector.len()).unwrap();
+                        write!(writer, "\n---- Size {} ({}) - {} files \n", format_size(*size, BINARY), size, vector.len()).unwrap();
                         for file_entry in vector {
                             writeln!(writer, "{}", file_entry.path.display()).unwrap();
                         }
@@ -1078,12 +1079,12 @@ impl SaveResults for DuplicateFinder {
                         "Found {} duplicated files which in {} groups which takes {}.",
                         self.information.number_of_duplicated_files_by_hash,
                         self.information.number_of_groups_by_hash,
-                        self.information.lost_space_by_hash.file_size(options::BINARY).unwrap()
+                        format_size(self.information.lost_space_by_hash, BINARY)
                     )
                     .unwrap();
                     for (size, vectors_vector) in self.files_with_identical_hashes.iter().rev() {
                         for vector in vectors_vector {
-                            writeln!(writer, "\n---- Size {} ({}) - {} files", size.file_size(options::BINARY).unwrap(), size, vector.len()).unwrap();
+                            writeln!(writer, "\n---- Size {} ({}) - {} files", format_size(*size, BINARY), size, vector.len()).unwrap();
                             for file_entry in vector {
                                 writeln!(writer, "{}", file_entry.path.display()).unwrap();
                             }
@@ -1136,11 +1137,11 @@ impl PrintResults for DuplicateFinder {
                     "Found {} duplicated files in {} groups with same content which took {}:",
                     number_of_files,
                     number_of_groups,
-                    self.information.lost_space_by_size.file_size(options::BINARY).unwrap()
+                    format_size(self.information.lost_space_by_size, BINARY)
                 );
                 for (size, vector) in self.files_with_identical_hashes.iter().rev() {
                     for j in vector {
-                        println!("Size - {} ({}) - {} files ", size.file_size(options::BINARY).unwrap(), size, j.len());
+                        println!("Size - {} ({}) - {} files ", format_size(*size, BINARY), size, j.len());
                         for k in j {
                             println!("{}", k.path.display());
                         }
@@ -1158,10 +1159,10 @@ impl PrintResults for DuplicateFinder {
                     "Found {} files in {} groups with same size(may have different content) which took {}:",
                     number_of_files,
                     number_of_groups,
-                    self.information.lost_space_by_size.file_size(options::BINARY).unwrap()
+                    format_size(self.information.lost_space_by_size, BINARY)
                 );
                 for (size, vector) in &self.files_with_identical_size {
-                    println!("Size - {} ({}) - {} files ", size.file_size(options::BINARY).unwrap(), size, vector.len());
+                    println!("Size - {} ({}) - {} files ", format_size(*size, BINARY), size, vector.len());
                     for j in vector {
                         println!("{}", j.path.display());
                     }
diff --git a/czkawka_core/src/similar_images.rs b/czkawka_core/src/similar_images.rs
index 43e822840..98a0a6f0f 100644
--- a/czkawka_core/src/similar_images.rs
+++ b/czkawka_core/src/similar_images.rs
@@ -12,7 +12,8 @@ use std::{fs, mem, thread};
 
 use bk_tree::BKTree;
 use crossbeam_channel::Receiver;
-use humansize::{file_size_opts as options, FileSize};
+use humansize::format_size;
+use humansize::BINARY;
 use image::GenericImageView;
 use image_hasher::{FilterType, HashAlg, HasherConfig};
 use rayon::prelude::*;
@@ -730,21 +731,66 @@ impl SimilarImages {
             //// PROGRESS THREAD END
 
             // Don't use hashes with multiple images in bktree, because they will always be master of group and cannot be find by other hashes
-            let mut additional_chunk_to_check: Vec<_> = Default::default();
-            let mut hashes_with_multiple_images: HashSet<_> = Default::default(); // Fast way to check if hash have multiple imaages
-            for (hash, vec_files) in &all_hashed_images {
-                if vec_files.len() >= 2 {
-                    additional_chunk_to_check.push(hash);
-                    hashes_with_multiple_images.insert(hash);
-                } else {
+            let mut hashes_with_multiple_images: HashSet<_> = Default::default(); // Fast way to check if hash have multiple images
+
+            let mut files_from_referenced_folders = HashMap::new();
+            let mut normal_files = HashMap::new();
+
+            let number_of_processors = num_cpus::get();
+            let chunk_size;
+            let mut chunks: Vec<&[&Vec<u8>]>;
+
+            let mut initial_hashes: Vec<&Vec<u8>> = Vec::new();
+            let mut additional_chunk_to_check: Vec<&Vec<u8>> = Default::default();
+
+            if self.use_reference_folders {
+                let reference_directories = self.directories.reference_directories.clone();
+                all_hashed_images.clone().into_iter().for_each(|(hash, vec_file_entry)| {
+                    for file_entry in vec_file_entry {
+                        if reference_directories.iter().any(|e| file_entry.path.starts_with(&e)) {
+                            files_from_referenced_folders.entry(hash.clone()).or_insert_with(Vec::new).push(file_entry);
+                        } else {
+                            normal_files.entry(hash.clone()).or_insert_with(Vec::new).push(file_entry);
+                        }
+                    }
+                });
+
+                for (hash, vec_files) in &normal_files {
+                    if vec_files.len() >= 2 {
+                        hashes_with_multiple_images.insert(hash);
+                    }
                     self.bktree.add(hash.to_vec());
                 }
-            }
+                for (hash, vec_files) in &files_from_referenced_folders {
+                    if vec_files.len() >= 2 {
+                        hashes_with_multiple_images.insert(hash);
+                    }
+                    initial_hashes.push(hash);
+                }
+                chunk_size = initial_hashes.len() / number_of_processors;
 
-            let number_of_processors = num_cpus::get();
-            let chunk_size = all_hashes.len() / number_of_processors;
-            let mut chunks: Vec<_> = if chunk_size > 0 { all_hashes.chunks(chunk_size).collect() } else { vec![&all_hashes] };
-            chunks.push(&additional_chunk_to_check);
+                chunks = if chunk_size > 0 {
+                    initial_hashes.chunks(chunk_size).collect::<Vec<_>>()
+                } else {
+                    vec![&initial_hashes]
+                };
+            } else {
+                for (hash, vec_files) in &all_hashed_images {
+                    if vec_files.len() >= 2 {
+                        additional_chunk_to_check.push(hash);
+                        hashes_with_multiple_images.insert(hash);
+                    } else {
+                        self.bktree.add(hash.to_vec());
+                    }
+                }
+                chunk_size = all_hashes.len() / number_of_processors;
+                chunks = if chunk_size > 0 {
+                    all_hashes.chunks(chunk_size).collect::<Vec<_>>()
+                } else {
+                    vec![&all_hashes]
+                };
+                chunks.push(&additional_chunk_to_check);
+            }
 
             let parts: Vec<_> = chunks
                 .into_par_iter()
@@ -775,7 +821,7 @@ impl SimilarImages {
                         let mut found_items = self
                             .bktree
                             .find(hash_to_check, tolerance)
-                            .filter(|(similarity, _hash)| *similarity != 0)
+                            .filter(|(similarity, _hash)| if self.use_reference_folders { true } else { *similarity != 0 })
                             .collect::<Vec<_>>();
 
                         found_items.sort_unstable_by_key(|f| f.0);
@@ -793,7 +839,9 @@ impl SimilarImages {
                     }
 
                     #[cfg(debug_assertions)]
-                    debug_check_for_duplicated_things(hashes_parents.clone(), hashes_similarity.clone(), all_hashed_images.clone(), "BEFORE");
+                    if !self.use_reference_folders {
+                        debug_check_for_duplicated_things(hashes_parents.clone(), hashes_similarity.clone(), all_hashed_images.clone(), "BEFORE");
+                    }
 
                     Some((hashes_parents, hashes_similarity))
                 })
@@ -839,7 +887,9 @@ impl SimilarImages {
                 }
 
                 #[cfg(debug_assertions)]
-                debug_check_for_duplicated_things(hashes_parents.clone(), hashes_similarity.clone(), all_hashed_images.clone(), "LATTER");
+                if !self.use_reference_folders {
+                    debug_check_for_duplicated_things(hashes_parents.clone(), hashes_similarity.clone(), all_hashed_images.clone(), "LATTER");
+                }
 
                 // Just simple check if all original hashes with multiple entries are available in end results
                 let original_hashes_at_start = hashes_with_multiple_images.len();
@@ -847,22 +897,58 @@ impl SimilarImages {
                     .iter()
                     .filter(|(parent_hash, _child_number)| hashes_with_multiple_images.contains(*parent_hash))
                     .count();
-                assert_eq!(original_hashes_at_start, original_hashes_in_end_results);
-                // Collecting results to vector
-                for (parent_hash, child_number) in hashes_parents {
-                    // If hash contains other hasher OR multiple images are available for checked hash
-                    if child_number > 0 || hashes_with_multiple_images.contains(parent_hash) {
-                        let vec_fe = all_hashed_images.get(parent_hash).unwrap().clone();
-                        collected_similar_images.insert(parent_hash.clone(), vec_fe);
-                    }
+                if !self.use_reference_folders {
+                    assert_eq!(original_hashes_at_start, original_hashes_in_end_results);
                 }
 
-                for (child_hash, (parent_hash, similarity)) in hashes_similarity {
-                    let mut vec_fe = all_hashed_images.get(child_hash).unwrap().clone();
-                    for mut fe in &mut vec_fe {
-                        fe.similarity = similarity;
+                if self.use_reference_folders {
+                    // This is same step as without reference folders, but also checks if children are inside/outside reference directories, because may happen, that one file is inside reference folder and other outside
+
+                    // Collecting results to vector
+                    for (parent_hash, child_number) in hashes_parents {
+                        // If hash contains other hasher OR multiple images are available for checked hash
+                        if child_number > 0 || hashes_with_multiple_images.contains(parent_hash) {
+                            let vec_fe = all_hashed_images
+                                .get(parent_hash)
+                                .unwrap()
+                                .iter()
+                                .filter(|e| is_in_reference_folder(&self.directories.reference_directories, &e.path))
+                                .cloned()
+                                .collect();
+                            collected_similar_images.insert(parent_hash.clone(), vec_fe);
+                        }
+                    }
+
+                    for (child_hash, (parent_hash, similarity)) in hashes_similarity {
+                        let mut vec_fe: Vec<_> = all_hashed_images
+                            .get(child_hash)
+                            .unwrap()
+                            .iter()
+                            .filter(|e| !is_in_reference_folder(&self.directories.reference_directories, &e.path))
+                            .cloned()
+                            .collect();
+                        for mut fe in &mut vec_fe {
+                            fe.similarity = similarity;
+                        }
+                        collected_similar_images.get_mut(parent_hash).unwrap().append(&mut vec_fe);
+                    }
+                } else {
+                    // Collecting results to vector
+                    for (parent_hash, child_number) in hashes_parents {
+                        // If hash contains other hasher OR multiple images are available for checked hash
+                        if child_number > 0 || hashes_with_multiple_images.contains(parent_hash) {
+                            let vec_fe = all_hashed_images.get(parent_hash).unwrap().clone();
+                            collected_similar_images.insert(parent_hash.clone(), vec_fe);
+                        }
+                    }
+
+                    for (child_hash, (parent_hash, similarity)) in hashes_similarity {
+                        let mut vec_fe = all_hashed_images.get(child_hash).unwrap().clone();
+                        for mut fe in &mut vec_fe {
+                            fe.similarity = similarity;
+                        }
+                        collected_similar_images.get_mut(parent_hash).unwrap().append(&mut vec_fe);
                     }
-                    collected_similar_images.get_mut(parent_hash).unwrap().append(&mut vec_fe);
                 }
             }
         }
@@ -1038,6 +1124,10 @@ fn image_to_check<'a>(
     }
 }
 
+fn is_in_reference_folder(reference_directories: &[PathBuf], path: &Path) -> bool {
+    reference_directories.iter().any(|e| path.starts_with(&e))
+}
+
 impl Default for SimilarImages {
     fn default() -> Self {
         Self::new()
@@ -1096,7 +1186,7 @@ impl SaveResults for SimilarImages {
                         "{} - {} - {} - {}",
                         file_entry.path.display(),
                         file_entry.dimensions,
-                        file_entry.size.file_size(options::BINARY).unwrap(),
+                        format_size(file_entry.size, BINARY),
                         get_string_from_similarity(&file_entry.similarity, self.hash_size)
                     )
                     .unwrap();
@@ -1123,7 +1213,7 @@ impl PrintResults for SimilarImages {
                         "{} - {} - {} - {}",
                         file_entry.path.display(),
                         file_entry.dimensions,
-                        file_entry.size.file_size(options::BINARY).unwrap(),
+                        format_size(file_entry.size, BINARY),
                         get_string_from_similarity(&file_entry.similarity, self.hash_size)
                     );
                 }
diff --git a/czkawka_core/src/similar_videos.rs b/czkawka_core/src/similar_videos.rs
index 35b81f337..e24fd928d 100644
--- a/czkawka_core/src/similar_videos.rs
+++ b/czkawka_core/src/similar_videos.rs
@@ -11,7 +11,8 @@ use std::{fs, mem, thread};
 
 use crossbeam_channel::Receiver;
 use ffmpeg_cmdline_utils::FfmpegErrorKind::FfmpegNotFound;
-use humansize::{file_size_opts as options, FileSize};
+use humansize::format_size;
+use humansize::BINARY;
 use rayon::prelude::*;
 use serde::{Deserialize, Serialize};
 use vid_dup_finder_lib::HashCreationErrorKind::DetermineVideo;
@@ -714,7 +715,7 @@ impl SaveResults for SimilarVideos {
             for struct_similar in self.similar_vectors.iter() {
                 writeln!(writer, "Found {} videos which have similar friends", self.similar_vectors.len()).unwrap();
                 for file_entry in struct_similar {
-                    writeln!(writer, "{} - {}", file_entry.path.display(), file_entry.size.file_size(options::BINARY).unwrap(),).unwrap();
+                    writeln!(writer, "{} - {}", file_entry.path.display(), format_size(file_entry.size, BINARY)).unwrap();
                 }
                 writeln!(writer).unwrap();
             }
@@ -734,7 +735,7 @@ impl PrintResults for SimilarVideos {
 
             for vec_file_entry in &self.similar_vectors {
                 for file_entry in vec_file_entry {
-                    println!("{} - {}", file_entry.path.display(), file_entry.size.file_size(options::BINARY).unwrap());
+                    println!("{} - {}", file_entry.path.display(), format_size(file_entry.size, BINARY));
                 }
                 println!();
             }
diff --git a/czkawka_gui/Cargo.toml b/czkawka_gui/Cargo.toml
index 638b40b21..fab1ed8d9 100644
--- a/czkawka_gui/Cargo.toml
+++ b/czkawka_gui/Cargo.toml
@@ -3,7 +3,7 @@ name = "czkawka_gui"
 version = "5.0.2"
 authors = ["Rafał Mikrut <mikrutrafal@protonmail.com>"]
 edition = "2021"
-rust-version = "1.60"
+rust-version = "1.62"
 description = "GTK frontend of Czkawka"
 license = "MIT"
 homepage = "https://github.com/qarmin/czkawka"
@@ -13,14 +13,14 @@ repository = "https://github.com/qarmin/czkawka"
 gdk4 = "0.4.8"
 glib = "0.15.12"
 
-humansize = "1.1.1"
+humansize = "2.0.0"
 chrono = "0.4.22"
 
 # Used for sending stop signal across threads
 crossbeam-channel = "0.5.6"
 
 # To get informations about progress
-futures = "0.3.23"
+futures = "0.3.24"
 
 # For saving/loading config files to specific directories
 directories-next = "2.0.0"
@@ -46,8 +46,8 @@ fs_extra = "1.2.0"
 # Language
 i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] }
 i18n-embed-fl = "0.6.4"
-rust-embed = "6.4.0"
-once_cell = "1.13.1"
+rust-embed = "6.4.1"
+once_cell = "1.14.0"
 
 [target.'cfg(windows)'.dependencies]
 winapi = { version = "0.3.9", features = ["combaseapi", "objbase", "shobjidl_core", "windef", "winerror", "wtypesbase", "winuser"] }
diff --git a/czkawka_gui/src/compute_results.rs b/czkawka_gui/src/compute_results.rs
index 11c0e7a04..609c7fb1f 100644
--- a/czkawka_gui/src/compute_results.rs
+++ b/czkawka_gui/src/compute_results.rs
@@ -6,7 +6,8 @@ use std::rc::Rc;
 use chrono::NaiveDateTime;
 use glib::Receiver;
 use gtk4::prelude::*;
-use humansize::{file_size_opts as options, FileSize};
+use humansize::format_size;
+use humansize::BINARY;
 
 use czkawka_core::common::split_path;
 use czkawka_core::common_dir_traversal::CheckingMethod;
@@ -117,7 +118,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                     generate_translation_hashmap(vec![
                                         ("number_files", duplicates_number.to_string()),
                                         ("number_groups", duplicates_group.to_string()),
-                                        ("size", duplicates_size.file_size(options::BINARY).unwrap())
+                                        ("size", format_size(duplicates_size, BINARY))
                                     ])
                                 )
                                 .as_str(),
@@ -133,7 +134,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                     generate_translation_hashmap(vec![
                                         ("number_files", duplicates_number.to_string()),
                                         ("number_groups", duplicates_group.to_string()),
-                                        ("size", duplicates_size.file_size(options::BINARY).unwrap())
+                                        ("size", format_size(duplicates_size, BINARY))
                                     ])
                                 )
                                 .as_str(),
@@ -171,7 +172,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                         let values: [(u32, &dyn ToValue); 10] = [
                                             (ColumnsDuplicates::ActivatableSelectButton as u32, &false),
                                             (ColumnsDuplicates::SelectionButton as u32, &false),
-                                            (ColumnsDuplicates::Size as u32, (&base_file_entry.size.file_size(options::BINARY).unwrap())),
+                                            (ColumnsDuplicates::Size as u32, (&format_size(base_file_entry.size, BINARY))),
                                             (ColumnsDuplicates::Name as u32, &file),
                                             (ColumnsDuplicates::Path as u32, &directory),
                                             (
@@ -192,7 +193,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                             let values: [(u32, &dyn ToValue); 10] = [
                                                 (ColumnsDuplicates::ActivatableSelectButton as u32, &true),
                                                 (ColumnsDuplicates::SelectionButton as u32, &false),
-                                                (ColumnsDuplicates::Size as u32, (&entry.size.file_size(options::BINARY).unwrap())),
+                                                (ColumnsDuplicates::Size as u32, (&format_size(entry.size, BINARY))),
                                                 (ColumnsDuplicates::Name as u32, &file),
                                                 (ColumnsDuplicates::Path as u32, &directory),
                                                 (
@@ -230,7 +231,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                             let values: [(u32, &dyn ToValue); 10] = [
                                                 (ColumnsDuplicates::ActivatableSelectButton as u32, &false),
                                                 (ColumnsDuplicates::SelectionButton as u32, &false),
-                                                (ColumnsDuplicates::Size as u32, (&base_file_entry.size.file_size(options::BINARY).unwrap())),
+                                                (ColumnsDuplicates::Size as u32, (&format_size(base_file_entry.size, BINARY))),
                                                 (ColumnsDuplicates::Name as u32, &file),
                                                 (ColumnsDuplicates::Path as u32, &directory),
                                                 (
@@ -251,7 +252,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                                 let values: [(u32, &dyn ToValue); 10] = [
                                                     (ColumnsDuplicates::ActivatableSelectButton as u32, &true),
                                                     (ColumnsDuplicates::SelectionButton as u32, &false),
-                                                    (ColumnsDuplicates::Size as u32, (&entry.size.file_size(options::BINARY).unwrap())),
+                                                    (ColumnsDuplicates::Size as u32, (&format_size(entry.size, BINARY))),
                                                     (ColumnsDuplicates::Name as u32, &file),
                                                     (ColumnsDuplicates::Path as u32, &directory),
                                                     (
@@ -290,7 +291,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                         let values: [(u32, &dyn ToValue); 10] = [
                                             (ColumnsDuplicates::ActivatableSelectButton as u32, &false),
                                             (ColumnsDuplicates::SelectionButton as u32, &false),
-                                            (ColumnsDuplicates::Size as u32, (&base_file_entry.size.file_size(options::BINARY).unwrap())),
+                                            (ColumnsDuplicates::Size as u32, (&format_size(base_file_entry.size, BINARY))),
                                             (ColumnsDuplicates::Name as u32, &file),
                                             (ColumnsDuplicates::Path as u32, &directory),
                                             (
@@ -310,7 +311,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                             let values: [(u32, &dyn ToValue); 10] = [
                                                 (ColumnsDuplicates::ActivatableSelectButton as u32, &true),
                                                 (ColumnsDuplicates::SelectionButton as u32, &false),
-                                                (ColumnsDuplicates::Size as u32, (&entry.size.file_size(options::BINARY).unwrap())),
+                                                (ColumnsDuplicates::Size as u32, (&format_size(entry.size, BINARY))),
                                                 (ColumnsDuplicates::Name as u32, &file),
                                                 (ColumnsDuplicates::Path as u32, &directory),
                                                 (
@@ -367,16 +368,12 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                             let values: [(u32, &dyn ToValue); 10] = [
                                                 (ColumnsDuplicates::ActivatableSelectButton as u32, &true),
                                                 (ColumnsDuplicates::SelectionButton as u32, &false),
-                                                (ColumnsDuplicates::Size as u32, (&entry.size.file_size(options::BINARY).unwrap())),
+                                                (ColumnsDuplicates::Size as u32, (&format_size(entry.size, BINARY))),
                                                 (ColumnsDuplicates::Name as u32, &file),
                                                 (ColumnsDuplicates::Path as u32, &directory),
                                                 (
                                                     ColumnsDuplicates::Modification as u32,
-                                                    &(format!(
-                                                        "{} - ({})",
-                                                        NaiveDateTime::from_timestamp(entry.modified_date as i64, 0),
-                                                        entry.size.file_size(options::BINARY).unwrap()
-                                                    )),
+                                                    &(format!("{} - ({})", NaiveDateTime::from_timestamp(entry.modified_date as i64, 0), format_size(entry.size, BINARY))),
                                                 ),
                                                 (ColumnsDuplicates::ModificationAsSecs as u32, &(entry.modified_date)),
                                                 (ColumnsDuplicates::Color as u32, &(MAIN_ROW_COLOR.to_string())),
@@ -424,7 +421,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                                 let values: [(u32, &dyn ToValue); 10] = [
                                                     (ColumnsDuplicates::ActivatableSelectButton as u32, &true),
                                                     (ColumnsDuplicates::SelectionButton as u32, &false),
-                                                    (ColumnsDuplicates::Size as u32, (&entry.size.file_size(options::BINARY).unwrap())),
+                                                    (ColumnsDuplicates::Size as u32, (&format_size(entry.size, BINARY))),
                                                     (ColumnsDuplicates::Name as u32, &file),
                                                     (ColumnsDuplicates::Path as u32, &directory),
                                                     (
@@ -476,7 +473,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                             let values: [(u32, &dyn ToValue); 10] = [
                                                 (ColumnsDuplicates::ActivatableSelectButton as u32, &true),
                                                 (ColumnsDuplicates::SelectionButton as u32, &false),
-                                                (ColumnsDuplicates::Size as u32, (&entry.size.file_size(options::BINARY).unwrap())),
+                                                (ColumnsDuplicates::Size as u32, (&format_size(entry.size, BINARY))),
                                                 (ColumnsDuplicates::Name as u32, &file),
                                                 (ColumnsDuplicates::Path as u32, &directory),
                                                 (
@@ -684,7 +681,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                             let (directory, file) = split_path(&file_entry.path);
                             let values: [(u32, &dyn ToValue); 7] = [
                                 (ColumnsBigFiles::SelectionButton as u32, &false),
-                                (ColumnsBigFiles::Size as u32, &(size.file_size(options::BINARY).unwrap())),
+                                (ColumnsBigFiles::Size as u32, &(format_size(*size, BINARY))),
                                 (ColumnsBigFiles::Name as u32, &file),
                                 (ColumnsBigFiles::Path as u32, &directory),
                                 (
@@ -831,7 +828,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                     (ColumnsSimilarImages::ActivatableSelectButton as u32, &false),
                                     (ColumnsSimilarImages::SelectionButton as u32, &false),
                                     (ColumnsSimilarImages::Similarity as u32, &"".to_string()),
-                                    (ColumnsSimilarImages::Size as u32, &base_file_entry.size.file_size(options::BINARY).unwrap()),
+                                    (ColumnsSimilarImages::Size as u32, &format_size(base_file_entry.size, BINARY)),
                                     (ColumnsSimilarImages::SizeAsBytes as u32, &base_file_entry.size),
                                     (ColumnsSimilarImages::Dimensions as u32, &base_file_entry.dimensions),
                                     (ColumnsSimilarImages::Name as u32, &file),
@@ -857,7 +854,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                             ColumnsSimilarImages::Similarity as u32,
                                             &(similar_images::get_string_from_similarity(&file_entry.similarity, hash_size).to_string()),
                                         ),
-                                        (ColumnsSimilarImages::Size as u32, &file_entry.size.file_size(options::BINARY).unwrap()),
+                                        (ColumnsSimilarImages::Size as u32, &format_size(file_entry.size, BINARY)),
                                         (ColumnsSimilarImages::SizeAsBytes as u32, &file_entry.size),
                                         (ColumnsSimilarImages::Dimensions as u32, &file_entry.dimensions),
                                         (ColumnsSimilarImages::Name as u32, &file),
@@ -915,7 +912,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                             ColumnsSimilarImages::Similarity as u32,
                                             &(similar_images::get_string_from_similarity(&file_entry.similarity, hash_size).to_string()),
                                         ),
-                                        (ColumnsSimilarImages::Size as u32, &file_entry.size.file_size(options::BINARY).unwrap()),
+                                        (ColumnsSimilarImages::Size as u32, &format_size(file_entry.size, BINARY)),
                                         (ColumnsSimilarImages::SizeAsBytes as u32, &file_entry.size),
                                         (ColumnsSimilarImages::Dimensions as u32, &file_entry.dimensions),
                                         (ColumnsSimilarImages::Name as u32, &file),
@@ -1013,7 +1010,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                 let values: [(u32, &dyn ToValue); 11] = [
                                     (ColumnsSimilarVideos::ActivatableSelectButton as u32, &false),
                                     (ColumnsSimilarVideos::SelectionButton as u32, &false),
-                                    (ColumnsSimilarVideos::Size as u32, &base_file_entry.size.file_size(options::BINARY).unwrap()),
+                                    (ColumnsSimilarVideos::Size as u32, &format_size(base_file_entry.size, BINARY)),
                                     (ColumnsSimilarVideos::SizeAsBytes as u32, &base_file_entry.size),
                                     (ColumnsSimilarVideos::Name as u32, &file),
                                     (ColumnsSimilarVideos::Path as u32, &directory),
@@ -1034,7 +1031,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                     let values: [(u32, &dyn ToValue); 11] = [
                                         (ColumnsSimilarVideos::ActivatableSelectButton as u32, &true),
                                         (ColumnsSimilarVideos::SelectionButton as u32, &false),
-                                        (ColumnsSimilarVideos::Size as u32, &file_entry.size.file_size(options::BINARY).unwrap()),
+                                        (ColumnsSimilarVideos::Size as u32, &format_size(file_entry.size, BINARY)),
                                         (ColumnsSimilarVideos::SizeAsBytes as u32, &file_entry.size),
                                         (ColumnsSimilarVideos::Name as u32, &file),
                                         (ColumnsSimilarVideos::Path as u32, &directory),
@@ -1088,7 +1085,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                     let values: [(u32, &dyn ToValue); 11] = [
                                         (ColumnsSimilarVideos::ActivatableSelectButton as u32, &true),
                                         (ColumnsSimilarVideos::SelectionButton as u32, &false),
-                                        (ColumnsSimilarVideos::Size as u32, &file_entry.size.file_size(options::BINARY).unwrap()),
+                                        (ColumnsSimilarVideos::Size as u32, &format_size(file_entry.size, BINARY)),
                                         (ColumnsSimilarVideos::SizeAsBytes as u32, &file_entry.size),
                                         (ColumnsSimilarVideos::Name as u32, &file),
                                         (ColumnsSimilarVideos::Path as u32, &directory),
@@ -1194,7 +1191,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                 let values: [(u32, &dyn ToValue); 18] = [
                                     (ColumnsSameMusic::ActivatableSelectButton as u32, &false),
                                     (ColumnsSameMusic::SelectionButton as u32, &false),
-                                    (ColumnsSameMusic::Size as u32, &base_file_entry.size.file_size(options::BINARY).unwrap()),
+                                    (ColumnsSameMusic::Size as u32, &format_size(base_file_entry.size, BINARY)),
                                     (ColumnsSameMusic::SizeAsBytes as u32, &base_file_entry.size),
                                     (ColumnsSameMusic::Name as u32, &file),
                                     (ColumnsSameMusic::Path as u32, &directory),
@@ -1220,7 +1217,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                     let values: [(u32, &dyn ToValue); 18] = [
                                         (ColumnsSameMusic::ActivatableSelectButton as u32, &true),
                                         (ColumnsSameMusic::SelectionButton as u32, &false),
-                                        (ColumnsSameMusic::Size as u32, &file_entry.size.file_size(options::BINARY).unwrap()),
+                                        (ColumnsSameMusic::Size as u32, &format_size(file_entry.size, BINARY)),
                                         (ColumnsSameMusic::SizeAsBytes as u32, &file_entry.size),
                                         (ColumnsSameMusic::Name as u32, &file),
                                         (ColumnsSameMusic::Path as u32, &directory),
@@ -1323,7 +1320,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
                                     let values: [(u32, &dyn ToValue); 18] = [
                                         (ColumnsSameMusic::ActivatableSelectButton as u32, &true),
                                         (ColumnsSameMusic::SelectionButton as u32, &false),
-                                        (ColumnsSameMusic::Size as u32, &file_entry.size.file_size(options::BINARY).unwrap()),
+                                        (ColumnsSameMusic::Size as u32, &format_size(file_entry.size, BINARY)),
                                         (ColumnsSameMusic::SizeAsBytes as u32, &file_entry.size),
                                         (ColumnsSameMusic::Name as u32, &file),
                                         (ColumnsSameMusic::Path as u32, &directory),
diff --git a/instructions/Compilation.md b/instructions/Compilation.md
index 22b6cb1f2..43a3b217f 100644
--- a/instructions/Compilation.md
+++ b/instructions/Compilation.md
@@ -11,7 +11,7 @@ Support for heif images is optional and require to install libheif library.
 
 | Program | Min  | What for                                                                      |
 |---------|------|-------------------------------------------------------------------------------|
-| Rust    | 1.60 | Czkawka, aims to support the latest available version of Rust on Ubuntu 22.04 |
+| Rust    | 1.62 | Czkawka, aims to support the latest available version of Rust on Ubuntu 22.04 |
 | GTK     | 4.6  | Only for the `GTK` backend                                                    |
 
 #### Debian / Ubuntu


Test patch: