Skip to content

Commit

Permalink
Dav1D
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin committed Oct 4, 2024
1 parent 02ef2df commit 4be1ee1
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install basic libraries
run: sudo apt update || true; sudo apt install libheif-de libraw-dev libavif-dev libdav1d-dev ffmpeg -y
run: sudo apt update || true; sudo apt install libheif-de libraw-dev ffmpeg -y

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/linux_gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install basic libraries
run: sudo apt update || true; sudo apt install libheif-dev libraw-dev libavif-dev libdav1d-dev -y
run: sudo apt update || true; sudo apt install libheif-dev libraw-dev -y

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}
Expand All @@ -56,13 +56,13 @@ jobs:
if: ${{ (matrix.type == 'release') }}

- name: Build Release Krokiet heif
run: cargo build --release --bin krokiet --features "heif,libraw,libavif"
run: cargo build --release --bin krokiet --features "heif,libraw"
if: ${{ (matrix.type == 'release') }}

- name: Store Linux GUI Krokiet heif libraw
uses: actions/upload-artifact@v4
with:
name: krokiet-${{ runner.os }}-${{ matrix.toolchain }}-heif-libraw-libavif
name: krokiet-${{ runner.os }}-${{ matrix.toolchain }}-heif-libraw
path: target/release/krokiet
if: ${{ matrix.type == 'release' }}

Expand All @@ -76,7 +76,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install basic libraries
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev libavif-dev libdav1d-dev -y
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev -y

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}
Expand All @@ -86,13 +86,13 @@ jobs:
if: ${{ (matrix.type == 'release') }}

- name: Build Release Heif Libraw
run: cargo build --release --bin czkawka_gui --features "heif,libraw,libavif"
run: cargo build --release --bin czkawka_gui --features "heif,libraw"
if: ${{ (matrix.type == 'release') }}

- name: Store Linux GUI Heif Libraw
uses: actions/upload-artifact@v4
with:
name: czkawka_gui-${{ runner.os }}-${{ matrix.toolchain }}-heif-libraw-libavif
name: czkawka_gui-${{ runner.os }}-${{ matrix.toolchain }}-heif-libraw
path: target/release/czkawka_gui
if: ${{ (matrix.type == 'release') && (matrix.toolchain == 'stable') }}

Expand All @@ -118,7 +118,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Dependencies
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev libavif-dev libdav1d-dev librsvg2-dev wget fuse libfuse2 desktop-file-utils -y
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev librsvg2-dev wget fuse libfuse2 desktop-file-utils -y

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Dependencies
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev libavif-dev libdav1d-dev librsvg2-dev wget fuse libfuse2 -y xvfb
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev librsvg2-dev wget fuse libfuse2 -y xvfb

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Gtk 4
run: sudo apt update || true; sudo apt install -y libgtk-4-dev libraw-dev libheif-dev libavif-dev libdav1d-dev -y
run: sudo apt update || true; sudo apt install -y libgtk-4-dev libraw-dev libheif-dev -y

- name: Check the format
run: cargo fmt --all -- --check
Expand Down
13 changes: 9 additions & 4 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
- Printing to file/console no longer uses two backslashes in windows
paths - [#1354](https://github.com/qarmin/czkawka/pull/1354)
- Fixed panic when failed to decode raw picture - [#1355](https://github.com/qarmin/czkawka/pull/1355)
- Remove useless saving/loading cache when there is no files to check - [#TODO](#TODO)
- Added jxl support - [#TODO](#TODO)
- Added avif support(via external C library, not enabled by default) - [#TODO](#TODO)
- Remove useless saving/loading cache when there is no files to
check - [#1358](https://github.com/qarmin/czkawka/pull/1358)
- Added jxl support - [#1358](https://github.com/qarmin/czkawka/pull/1358)
- Added avif support(via external C library, not enabled by
default) - [#1358](https://github.com/qarmin/czkawka/pull/1358)
- Integer overflow are enabled by default(prepare for reporting bugs, slower performance and
unstability) - [#1358](https://github.com/qarmin/czkawka/pull/1358)

### Krokiet

Expand All @@ -31,7 +35,8 @@
### GTK GUI

- Fixed and added more input parameters to the application - [#1355](https://github.com/qarmin/czkawka/pull/1355)
- Added option to use external libraries instead gtk pixbuf loader for previews - [#TODO](#TODO)
- Added option to use external libraries instead gtk pixbuf loader for
previews - [#1358](https://github.com/qarmin/czkawka/pull/1358)
- [External contribution] Mac homebrew version of app - https://formulae.brew.sh/formula/czkawka

### CLI
Expand Down
3 changes: 2 additions & 1 deletion czkawka_cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Windows 7.
On linux it is even possible with eyra to avoid entirely libc and using fully static rust binary.

If you want to use similar videos tool, you need to install ffmpeg(runtime dependency).
If you want to use heif/libraw(build/runtime dependency) you need to install required packages.
If you want to use heif/libraw/libavif(build/runtime dependency) you need to install required packages(may require
bigger os version than czkawka).

- mac - `brew install ffmpeg libraw libheif libavif` - https://formulae.brew.sh/formula/ffmpeg
- linux - `sudo apt install ffmpeg libraw-dev libheif-dev libavif-dev libdav1d-dev`
Expand Down
1 change: 1 addition & 0 deletions czkawka_core/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub fn print_version_mode() {
let info = os_info::get();

#[allow(unused_mut)]
#[allow(clippy::vec_init_then_push)]
let mut features: Vec<&str> = vec![];
#[cfg(feature = "heif")]
features.push("heif");
Expand Down
1 change: 0 additions & 1 deletion czkawka_core/src/common_cache.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use bincode::Options;
use fun_time::fun_time;
use image::imageops::FilterType;
use image_hasher::HashAlg;
Expand Down
12 changes: 1 addition & 11 deletions czkawka_core/src/similar_images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ impl FileEntry {
}
}

// TODO remove this, it is not needed, but it will break deserialization
// Remove this in next breaking release
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub enum ImageType {
Normal,
Raw,
Heic,
Unknown,
}

#[derive(Clone, Debug, Copy)]
pub enum SimilarityPreset {
Original,
Expand Down Expand Up @@ -1028,7 +1018,7 @@ mod tests {
use std::path::PathBuf;

use crate::common_tool::CommonData;
use crate::similar_images::{Hamming, ImHash, ImageType, ImagesEntry, SimilarImages, SimilarImagesParameters};
use crate::similar_images::{Hamming, ImHash, ImagesEntry, SimilarImages, SimilarImagesParameters};
use bk_tree::BKTree;
use image::imageops::FilterType;
use image_hasher::HashAlg;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ lot build and runtime dependencies.
```shell
sudo apt install libgtk-4-dev libheif-dev libraw-dev libavif-dev libdav1d-dev -y
cargo run --release --bin czkawka_gui
# Or with support for heif, libraw, libavif(this are c libraries)
# Or with support for heif, libraw, libavif(this are c libraries and may require greater version package/os version)
cargo run --release --bin czkawka_gui --features "heif,libraw,libavif"
```

Expand All @@ -88,7 +88,7 @@ cargo run --release --bin czkawka_gui --features "heif,libraw,libavif"
brew install rustup gtk4 adwaita-icon-theme ffmpeg librsvg libheif libraw pkg-config
rustup-init
cargo run --release --bin czkawka_gui
# Or with support for heif, libraw, libavif(this are c libraries)
# Or with support for heif, libraw, libavif(this are c libraries and may require greater version package/os version)
cargo run --release --bin czkawka_gui --features "heif,libraw,libavif"
```

Expand Down
2 changes: 0 additions & 2 deletions czkawka_gui/src/initialize_gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ fn show_preview(
}

let mut pixbuf = if use_rust_preview {
dbg!("Using Rust preview");
let image = match get_dynamic_image_from_path(&file_name) {
Ok(t) => t,
Err(e) => {
Expand All @@ -525,7 +524,6 @@ fn show_preview(
}
}
} else {
dbg!("Using GTK preview");
match Pixbuf::from_file(&file_name) {
Ok(pixbuf) => pixbuf,
Err(e) => {
Expand Down
11 changes: 9 additions & 2 deletions czkawka_gui/src/saving_loading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const DEFAULT_GENERAL_IGNORE_OTHER_FILESYSTEMS: bool = false;
const DEFUALT_USING_RUST_LIBRARIES_TO_SHOW_PREVIEW: bool = true;

const DEFAULT_MUSIC_APPROXIMATE_COMPARISON: bool = false;
const DEFAULT_MUSIC_COMPARE_BY_TITLE: bool = false;
const DEFAULT_MUSIC_GROUP_CONTENT_BY_TITLE: bool = false;

const DEFAULT_BROKEN_FILES_PDF: bool = true;
const DEFAULT_BROKEN_FILES_AUDIO: bool = true;
Expand Down Expand Up @@ -697,7 +697,7 @@ pub fn load_configuration(
let similar_videos_ignore_same_size = loaded_entries.get_bool(hashmap_ls[&LoadText::SimilarVideosIgnoreSameSize].clone(), DEFAULT_SIMILAR_VIDEOS_IGNORE_SAME_SIZE);
let check_button_case_sensitive_name = loaded_entries.get_object(hashmap_ls[&LoadText::DuplicateNameCaseSensitive].clone(), DEFAULT_DUPLICATE_CASE_SENSITIVE_NAME_CHECKING);
let check_button_music_approximate_comparison = loaded_entries.get_object(hashmap_ls[&LoadText::MusicApproximateComparison].clone(), DEFAULT_MUSIC_APPROXIMATE_COMPARISON);
let check_button_music_compare_by_title = loaded_entries.get_object(hashmap_ls[&LoadText::MusicCompareByTitle].clone(), DEFAULT_MUSIC_COMPARE_BY_TITLE);
let check_button_music_compare_by_title = loaded_entries.get_object(hashmap_ls[&LoadText::MusicCompareByTitle].clone(), DEFAULT_MUSIC_GROUP_CONTENT_BY_TITLE);

let check_button_broken_files_archive = loaded_entries.get_object(hashmap_ls[&LoadText::BrokenFilesArchive].clone(), DEFAULT_BROKEN_FILES_ARCHIVE);
let check_button_broken_files_pdf = loaded_entries.get_object(hashmap_ls[&LoadText::BrokenFilesPdf].clone(), DEFAULT_BROKEN_FILES_PDF);
Expand Down Expand Up @@ -979,6 +979,7 @@ pub fn reset_configuration(manual_clearing: bool, upper_notebook: &GuiUpperNoteb
settings.entry_settings_prehash_cache_file_minimal_size.set_text(DEFAULT_PREHASH_MINIMAL_CACHE_SIZE);
settings.combo_box_settings_language.set_active(Some(0));
settings.check_button_settings_one_filesystem.set_active(DEFAULT_GENERAL_IGNORE_OTHER_FILESYSTEMS);
settings.check_button_settings_use_rust_preview.set_active(DEFUALT_USING_RUST_LIBRARIES_TO_SHOW_PREVIEW);

main_notebook.combo_box_duplicate_hash_type.set_active(Some(0));
main_notebook.combo_box_duplicate_check_method.set_active(Some(0));
Expand All @@ -995,6 +996,12 @@ pub fn reset_configuration(manual_clearing: bool, upper_notebook: &GuiUpperNoteb
main_notebook.scale_similarity_similar_images.set_range(0_f64, SIMILAR_VALUES[0][5] as f64); // DEFAULT FOR MAX of 8
main_notebook.scale_similarity_similar_images.set_fill_level(SIMILAR_VALUES[0][5] as f64);

main_notebook
.check_button_music_compare_only_in_title_group
.set_active(DEFAULT_MUSIC_GROUP_CONTENT_BY_TITLE);

main_notebook.check_button_music_approximate_comparison.set_active(DEFAULT_MUSIC_APPROXIMATE_COMPARISON);

main_notebook.entry_big_files_number.set_text(DEFAULT_NUMBER_OF_BIGGEST_FILES);
main_notebook.scale_similarity_similar_images.set_value(DEFAULT_SIMILAR_IMAGES_SIMILARITY as f64);
main_notebook.check_button_image_ignore_same_size.set_active(DEFAULT_SIMILAR_IMAGES_IGNORE_SAME_SIZE);
Expand Down

0 comments on commit 4be1ee1

Please sign in to comment.