mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-23 19:03:54 +01:00
Tie merged PSD borrow to input
This commit is contained in:
1 parent
5d26a44ae7
commit
e647db4e1a
1 file changed
+2
-2
@@ -4,7 +4,7 @@
|
||||
//! Also a flat-file writer ([`encode`]): the merged image of an 8- or 16-bit gray/RGB document
|
||||
//! with no layers, so an image editor opens it as one background layer and saves back to it.
|
||||
|
||||
use crate::convert::{Buf, Meta, Model, Raw, check_size, finish};
|
||||
use crate::convert::{Buf, Meta, Model, Raw, finish};
|
||||
use crate::encode::{EncodeImage, EncodeMeta, Samples};
|
||||
use crate::{DecodeOptions, Decoded, Error, Format, Result};
|
||||
|
||||
@@ -38,7 +38,7 @@ impl<'a> Rd<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn open_merged(bytes: &[u8], opts: &DecodeOptions) -> Result<craft_psd::merged::Merged<'_>> {
|
||||
fn open_merged<'a>(bytes: &'a [u8], opts: &DecodeOptions) -> Result<craft_psd::merged::Merged<'a>> {
|
||||
craft_psd::merged::Merged::open(bytes, opts.max_pixels).map_err(|error| match error {
|
||||
craft_psd::PsdError::LimitExceeded("pixel count") => {
|
||||
let (w, h) = craft_psd::merged::declared_dimensions(bytes).unwrap_or((0, 0));
|
||||
|
||||
Reference in new issue
Block a user