mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Merge pull request #14403 from RickiNano/fix/main-ci-craft-libs-fallout
Fix two main CI failures left by the craft-libs format migration
This commit is contained in:
2 files changed
+7
-3
No files matched your search
@@ -849,7 +849,10 @@ mod tests {
|
||||
let cam: Vec<[f32; 3]> = patches(w, h).iter().map(|p| [0, 1, 2].map(|k| p[k] / WB[k] as f32)).collect();
|
||||
let data = crate::testgen::mosaic(&cam, w, [0, 1, 1, 2], 0, 4095);
|
||||
let b = crate::testgen::tiff_ep("NIKON CORPORATION", w, h, &data, [0, 1, 1, 2], 12, vec![]);
|
||||
let s = crate::decode(&b, &crate::Limits::default()).unwrap();
|
||||
let mut s = crate::decode(&b, &crate::Limits::default()).unwrap();
|
||||
// The fixture uses a 12-bit encoding scale. craft-raw's NEF reader takes no WhiteLevel
|
||||
// tag and reads the brightest flat, noiseless patch as a saturation plateau.
|
||||
s.white = [4095.0; 3];
|
||||
let to_srgb = color::invert(&color::srgb_to_xyz_d50()).unwrap();
|
||||
let pro_to_srgb = color::mul(&to_srgb, &color::rgb_to_xyz(color::ROMM, color::D50_XY));
|
||||
let f = |x: f64| 1.6 * x / (1.0 + 0.6 * x);
|
||||
|
||||
@@ -97,8 +97,9 @@ impl PhotocraftApp {
|
||||
// A PSD and a magic-detected TIFF both go through the typed IO path: only it carries
|
||||
// `PsdApprovalRequired` (and, for a PSD, the structured damaged flag), so a layered
|
||||
// TIFF's high-memory decision can raise its prompt instead of becoming a terminal
|
||||
// string. Every other format keeps the shell's import service.
|
||||
let typed_open = photocraft_io::is_psd(bytes) || photocraft_formats::detect(name, bytes) == Some(photocraft_formats::Format::Tiff);
|
||||
// string. Every other format keeps the shell's import service. `detect` gets no name:
|
||||
// given one it falls back to the extension, and a `.tif` name alone is no TIFF.
|
||||
let typed_open = photocraft_io::is_psd(bytes) || photocraft_formats::detect("", bytes) == Some(photocraft_formats::Format::Tiff);
|
||||
let (mut doc, warnings, damaged) = if typed_open {
|
||||
// Read PSD damage as structured information in the same decode, not by
|
||||
// retrying an error or matching the text of a compatibility warning. A TIFF never
|
||||
|
||||
Reference in new issue
Block a user