psd
psd copied to clipboard
DescriptorStructure can occur inside an ImageResourcesBlock
Inside read_resource_block
, some resource_id
s like 3000
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 with data_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 in read_resource_block
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.