mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
fix: synchronize test dependencies and repair CI compile diagnostics
This commit is contained in:
1 parent
5992650b36
commit
e97480ac76
4 files changed
+15
-14
No files matched your search
Generated
+1
@@ -5074,6 +5074,7 @@ dependencies = [
|
||||
"photocraft-engine",
|
||||
"photocraft-format",
|
||||
"photocraft-io",
|
||||
"photocraft-psd",
|
||||
"photocraft-raster",
|
||||
"photocraft-raw",
|
||||
"rmcp",
|
||||
|
||||
@@ -577,7 +577,7 @@ impl SourceFingerprint {
|
||||
match source {
|
||||
OpenSource::Bytes(b) => Ok(SourceFingerprint::Bytes { len: b.len(), identity: Arc::as_ptr(b) as usize }),
|
||||
OpenSource::Path(p) => {
|
||||
Self::path(p.clone(), photocraft_io::FileIdentity::of_path(std::path::Path::new(p)).map_err(|e| EngineError::Other(format!("{p}: {e}")))?)
|
||||
Ok(Self::path(p.clone(), photocraft_io::FileIdentity::of_path(std::path::Path::new(p)).map_err(|e| EngineError::Other(format!("{p}: {e}")))?))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1562,7 +1562,7 @@ mod tiff_banded_tests {
|
||||
let img = Image::from_raw(64, 64, ChannelLayout::Rgb, CSample::U8, vec![77; 64 * 64 * 3]).unwrap();
|
||||
let bytes = codecs::encode(&img, Format::Tiff, &codecs::EncodeOptions::default()).unwrap();
|
||||
let bands = codecs::TiffBands::open(&bytes, None, &codecs::Limits::banded()).unwrap();
|
||||
let r = tiff_to_document("small.tif", bands.upright(), || Some(0), BAND_BYTES).unwrap();
|
||||
let r = tiff_to_document("small.tif", bands.upright(), || Some(0), BAND_BYTES, &photocraft_raster::Interrupt::NONE).unwrap();
|
||||
assert_eq!((r.document.size.width, r.document.size.height), (64, 64));
|
||||
}
|
||||
|
||||
@@ -1578,7 +1578,7 @@ mod tiff_banded_tests {
|
||||
let bytes = codecs::encode(&img, Format::Tiff, &codecs::EncodeOptions::default()).unwrap();
|
||||
let bands = codecs::TiffBands::open(&bytes, None, &codecs::Limits::banded()).unwrap();
|
||||
let row = w as usize * layout.channels() * sample.bytes();
|
||||
let r = tiff_to_document("rounds.tif", bands, || None, 3 * row).unwrap();
|
||||
let r = tiff_to_document("rounds.tif", bands, || None, 3 * row, &photocraft_raster::Interrupt::NONE).unwrap();
|
||||
let f = document_format(layout, sample);
|
||||
let want = codecs::decode(&bytes).unwrap().convert(f.layout, f.sample);
|
||||
let LayerContent::Raster(s) = &r.document.layers[0].content else { panic!("not a raster layer") };
|
||||
|
||||
+11
-11
@@ -1128,17 +1128,17 @@ pub(super) mod linux {
|
||||
let mut out = Vec::with_capacity(bytes.len());
|
||||
let mut index = 0;
|
||||
while let Some(&byte) = bytes.get(index) {
|
||||
if byte == b'\\' {
|
||||
if let Some(digits) = bytes.get(index + 1..index + 4) {
|
||||
let code = digits.iter().try_fold(0u32, |acc, digit| {
|
||||
let value = digit.checked_sub(b'0')?;
|
||||
(value < 8).then_some(acc * 8 + u32::from(value))
|
||||
});
|
||||
if let Some(byte) = code.and_then(|code| u8::try_from(code).ok()) {
|
||||
out.push(byte);
|
||||
index += 4;
|
||||
continue;
|
||||
}
|
||||
if byte == b'\\'
|
||||
&& let Some(digits) = bytes.get(index + 1..index + 4)
|
||||
{
|
||||
let code = digits.iter().try_fold(0u32, |acc, digit| {
|
||||
let value = digit.checked_sub(b'0')?;
|
||||
(value < 8).then_some(acc * 8 + u32::from(value))
|
||||
});
|
||||
if let Some(byte) = code.and_then(|code| u8::try_from(code).ok()) {
|
||||
out.push(byte);
|
||||
index += 4;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
out.push(byte);
|
||||
|
||||
Reference in new issue
Block a user