Skip to content

Commit

Permalink
Regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin committed Feb 25, 2025
1 parent cb2381d commit 0b4dbfe
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
run: sudo apt update || true; sudo apt install -y libgtk-4-dev libraw-dev libheif-dev libavif-dev libdav1d-dev -y

- name: Setup rust version
run: rustup default 1.85.0
run: |
rustup default 1.85.0
rustup component add rustfmt
rustup component add clippy
- name: Check the format
run: cargo fmt --all -- --check
Expand Down
4 changes: 2 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
- Using reusable and bigger buffer for reading files in duplicate mode - [#1425](https://github.com/qarmin/czkawka/pull/1425)
- Option to use a lot of faster image resizing, to speedup image hashing - [#1458](https://github.com/qarmin/czkawka/pull/1458)
- Added to logs info about os and compiled app features - [#1458](https://github.com/qarmin/czkawka/pull/1458)
- Added size progress in duplicate mode - [#1458](https://github.com/qarmin/czkawka/pull/1458)
- Added size progress in duplicate and similar images mode - [#1458](https://github.com/qarmin/czkawka/pull/1458)
- Ability to stop calculating hash of bigger files in the middle of process - [#1458](https://github.com/qarmin/czkawka/pull/1458)
- Using multithreading, to filter out hard links - [#1458](https://github.com/qarmin/czkawka/pull/1458)
- Decreased prehash read file size to max 4k bytes - [#1458](https://github.com/qarmin/czkawka/pull/1458)

### Krokiet
- Changed default tab to duplicate files - [#1368](https://github.com/qarmin/czkawka/pull/1368)
- Progress bar in duplicate mode, now shows progress of processed bytes, not files - [#1458](https://github.com/qarmin/czkawka/pull/1458)
- Progress bar in duplicate and similar images mode, now shows progress of processed bytes, not files - [#1458](https://github.com/qarmin/czkawka/pull/1458)

### GTK GUI
- Added window icon in wayland - [#1400](https://github.com/qarmin/czkawka/pull/1400)
Expand Down
12 changes: 8 additions & 4 deletions czkawka_core/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,24 @@ pub fn print_version_mode() {
if cfg!(target_feature = "sse2") {
app_cpu_version = "x86-64-v1 (SSE2)";
}
if cfg!(any(target_arch = "x86", target_arch = "x86_64")) && is_x86_feature_detected!("sse2") {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
if is_x86_feature_detected!("sse2") {
os_cpu_version = "x86-64-v1 (SSE2)";
}

if cfg!(target_feature = "popcnt") {
app_cpu_version = "x86-64-v2 (SSE4.2 + POPCNT)";
}
if cfg!(any(target_arch = "x86", target_arch = "x86_64")) && is_x86_feature_detected!("popcnt") {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
if is_x86_feature_detected!("popcnt") {
os_cpu_version = "x86-64-v2 (SSE4.2 + POPCNT)";
}

if cfg!(target_feature = "avx2") {
app_cpu_version = "x86-64-v3 (AVX2) or x86-64-v4 (AVX-512)";
}
if cfg!(any(target_arch = "x86", target_arch = "x86_64")) && is_x86_feature_detected!("avx2") {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
if is_x86_feature_detected!("avx2") {
os_cpu_version = "x86-64-v3 (AVX2)";
}

Expand All @@ -115,7 +118,8 @@ pub fn print_version_mode() {
if cfg!(target_feature = "avx512f") {
app_cpu_version = "x86-64-v4 (AVX-512)";
}
if cfg!(any(target_arch = "x86", target_arch = "x86_64")) && is_x86_feature_detected!("avx512f") {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
if is_x86_feature_detected!("avx512f") {
os_cpu_version = "x86-64-v4 (AVX-512)";
}

Expand Down
5 changes: 3 additions & 2 deletions czkawka_core/src/similar_images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ impl SimilarImages {

let (loaded_hash_map, records_already_cached, non_cached_files_to_check) = self.hash_images_load_cache();

let (progress_thread_handle, progress_thread_run, items_counter, check_was_stopped, _size_counter) = prepare_thread_handler_common(
let (progress_thread_handle, progress_thread_run, items_counter, check_was_stopped, size_counter) = prepare_thread_handler_common(
progress_sender,
CurrentStage::SimilarImagesCalculatingHashes,
non_cached_files_to_check.len(),
self.get_test_type(),
0,
non_cached_files_to_check.values().map(|entry| entry.size).sum(),
);

debug!("hash_images - start hashing images");
Expand All @@ -291,6 +291,7 @@ impl SimilarImages {
check_was_stopped.store(true, Ordering::Relaxed);
return None;
}
size_counter.fetch_add(file_entry.size, Ordering::Relaxed);
if let Err(e) = self.collect_image_file_entry(&mut file_entry) {
return Some(Err(e));
}
Expand Down
2 changes: 1 addition & 1 deletion czkawka_gui/i18n/en/czkawka_gui.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ progress_scanning_general_file = {$file_number ->
progress_scanning_extension_of_files = Checking extension of {$file_checked}/{$all_files} file
progress_scanning_broken_files = Checking {$file_checked}/{$all_files} file
progress_scanning_video = Hashing of {$file_checked}/{$all_files} video
progress_scanning_image = Hashing of {$file_checked}/{$all_files} image
progress_scanning_image = Hashing of {$file_checked}/{$all_files} image ({$data_checked}/{$all_data})
progress_comparing_image_hashes = Comparing {$file_checked}/{$all_files} image hash
progress_scanning_music_tags_end = Comparing tags of {$file_checked}/{$all_files} music file
progress_scanning_music_tags = Reading tags of {$file_checked}/{$all_files} music file
Expand Down
15 changes: 11 additions & 4 deletions czkawka_gui/src/connect_things/connect_progress_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,21 @@ fn progress_default(gui_data: &GuiData, item: &ProgressData) {
}

fn common_set_data(item: &ProgressData, progress_bar_all_stages: &ProgressBar, progress_bar_current_stage: &ProgressBar, taskbar_state: &Rc<RefCell<TaskbarProgress>>) {
let (current_items_checked, current_stage_items_to_check) = if item.bytes_to_check > 0 {
(item.bytes_checked, item.bytes_to_check)
} else {
(item.entries_checked as u64, item.entries_to_check as u64)
};

if item.entries_to_check != 0 {
let all_stages = (item.current_stage_idx as f64 + item.entries_checked as f64 / item.entries_to_check as f64) / (item.max_stage_idx + 1) as f64;
let all_stages = (item.current_stage_idx as f64 + current_items_checked as f64 / current_stage_items_to_check as f64) / (item.max_stage_idx + 1) as f64;
let all_stages = all_stages.min(0.99);
progress_bar_all_stages.set_fraction(all_stages);
progress_bar_current_stage.set_fraction(item.entries_checked as f64 / item.entries_to_check as f64);
progress_bar_current_stage.set_fraction(current_items_checked as f64 / item.entries_to_check as f64);

taskbar_state.borrow().set_progress_value(
((item.current_stage_idx as usize) * item.entries_to_check + item.entries_checked) as u64,
item.entries_to_check as u64 * (item.max_stage_idx + 1) as u64,
(item.current_stage_idx as u64) * current_stage_items_to_check + current_items_checked,
current_stage_items_to_check * (item.max_stage_idx + 1) as u64,
);
} else {
let all_stages = (item.current_stage_idx as f64) / (item.max_stage_idx + 1) as f64;
Expand Down
18 changes: 15 additions & 3 deletions krokiet/src/connect_progress_receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ fn progress_default(item: &ProgressData) -> ProgressToSend {
format!("Comparing content of {}/{} audio file", item.entries_checked, item.entries_to_check)
}
CurrentStage::SimilarImagesCalculatingHashes => {
format!("Hashing of {}/{} image", item.entries_checked, item.entries_to_check)
format!(
"Hashing of {}/{} image ({}/{})",
item.entries_checked,
item.entries_to_check,
format_size(item.bytes_checked, BINARY),
format_size(item.bytes_to_check, BINARY)
)
}
CurrentStage::SimilarImagesComparingHashes => {
format!("Comparing {}/{} image hash", item.entries_checked, item.entries_to_check)
Expand Down Expand Up @@ -148,11 +154,17 @@ fn no_current_stage_get_data(item: &ProgressData) -> (i32, i32) {

// Used to calculate number of files to check and also to calculate current progress according to number of files to check and checked
fn common_get_data(item: &ProgressData) -> (i32, i32, i32) {
let (current_items_checked, current_stage_items_to_check) = if item.bytes_to_check > 0 {
(item.bytes_checked, item.bytes_to_check)
} else {
(item.entries_checked as u64, item.entries_to_check as u64)
};

if item.entries_to_check != 0 {
let all_stages = (item.current_stage_idx as f64 + item.entries_checked as f64 / item.entries_to_check as f64) / (item.max_stage_idx + 1) as f64;
let all_stages = (item.current_stage_idx as f64 + current_items_checked as f64 / current_stage_items_to_check as f64) / (item.max_stage_idx + 1) as f64;
let all_stages = all_stages.min(0.99);

let current_stage = item.entries_checked as f64 / item.entries_to_check as f64;
let current_stage = current_items_checked as f64 / current_stage_items_to_check as f64;
let current_stage = current_stage.min(0.99);

let current_stage_size = if item.bytes_to_check != 0 {
Expand Down
2 changes: 1 addition & 1 deletion krokiet/ui/progress.slint
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export component Progress {
Text {
visible: progress_datas.current_progress >= -0.001;
vertical-alignment: TextVerticalAlignment.center;
text: progress_datas.current_progress + "%";
text: (progress_datas.current_progress_size == -1 ? progress_datas.current_progress : progress_datas.current_progress_size) + "%";
}

Text {
Expand Down

0 comments on commit 0b4dbfe

Please sign in to comment.