mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 09:26:43 +00:00
fix(psd): mark layers with no recognized channels as damaged
Use `warn_unreadable_data` instead of `warn` when a layer has no recognized channel data. This ensures the import is flagged as damaged and triggers the interactive confirmation dialog, warning users that saving the document may discard unrecognized channel data.
This commit is contained in:
1 parent
8b2c722dc8
commit
dc1ced7063
1 file changed
+1
-1
@@ -226,7 +226,7 @@ impl Ctx<'_> {
|
||||
// Only decoded channel data justifies a buffer: the decoders bound their output by the
|
||||
// bytes in the file, but a bare rectangle can declare 300000² pixels in a few bytes (#755).
|
||||
if planes.iter().all(Option::is_none) {
|
||||
self.warn(format!("layer \"{name}\": no channel data for its {w}x{h} bounds; treated as empty"));
|
||||
self.warn_unreadable_data(format!("layer \"{name}\": no channel data for its {w}x{h} bounds; treated as empty"));
|
||||
return Surface::new(self.fmt);
|
||||
}
|
||||
let refs: Vec<Option<&[u8]>> = planes.iter().map(|p| p.as_deref()).collect();
|
||||
|
||||
Reference in new issue
Block a user