Open joedevivo opened 1 year ago
Hey, thanks for reporting this issue.
Can you create a minimal PSD that can be used to reproduce this issue?
Here are some examples https://github.com/chinedufn/psd/tree/master/tests/fixtures
Then we'd add a test to the image resources section. Here's an example test https://github.com/chinedufn/psd/blob/3d4c1960fc141bbf13710646e11870b3a3b97898/tests/image_resources_section.rs#L8-L32
From there we can figure out how to get the test passing.
Inside
read_resource_block
, someresource_id
s like3000
expect the value to be a Descriptor. I actually encountered this because when it is a Descriptor, I'm not sure what the deal is withdata_len
, but it is way off. This caused an Index out of bounds error, as it was trying to read the cursor way too far.I tried to reverse engineer the binary, along with reading from the PSD file spec, but there's still just some bits in there I can't figure out, especially at the beginning with the data length.
I think something similar to what you're doing in
read_slice_block
could work, but I'm not quite sure how to set that up properly inread_resource_block