Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print currently decoding file to debug #1444

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions czkawka_core/src/common_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use jxl_oxide::{JxlImage, PixelFormat};
use libheif_rs::{ColorSpace, HeifContext, RgbChroma};
#[cfg(feature = "libraw")]
use libraw::Processor;
use log::{LevelFilter, Record, debug, error, info, warn};
use log::{LevelFilter, Record, debug, error, info, trace, warn};
use nom_exif::{ExifIter, ExifTag, MediaParser, MediaSource};
use rawloader::RawLoader;
use symphonia::core::conv::IntoSample;
Expand All @@ -47,6 +47,7 @@ pub fn get_jxl_image(path: &str) -> anyhow::Result<DynamicImage> {
pub fn get_dynamic_image_from_path(path: &str) -> Result<DynamicImage, String> {
let path_lower = Path::new(path).extension().unwrap_or_default().to_string_lossy().to_lowercase();

trace!("decoding file {}", path);
let res = panic::catch_unwind(|| {
if HEIC_EXTENSIONS.iter().any(|ext| path_lower.ends_with(ext)) {
#[cfg(feature = "heif")]
Expand Down Expand Up @@ -161,7 +162,7 @@ pub fn get_raw_image(path: impl AsRef<Path> + std::fmt::Debug) -> Result<Dynamic
times.push(("After creating dynamic image", start_timer.elapsed()));

let str_timer = times.into_iter().map(|(name, time)| format!("{name}: {time:?}")).collect::<Vec<_>>().join(", ");
debug!("Loading raw image --- {str_timer}");
trace!("Loading raw image --- {str_timer}");
Ok(res)
}

Expand Down
Loading