Closed gyk closed 2 years ago
Ah, thanks for the bug report. I'd be happy to review a PR that fixes this!
Besides 'luni', I'm not sure whether the unicode string of "name from classID" uses paddings. PSD.rb apparently reads no paddings: link. Maybe read_unicode_string
should default to read_unicode_string_padding(1)
?
Ah, thanks for researching this!
I think we'd just want to add test fixture PSDs with different layer types and see whether or not they pass. Then if they fail modify the code to make them pass.
I have a PSD file where the unicode string inside
luni
additional layer info has neither null bytes nor paddings:However, the current implementation decodes it as a unicode string with a padding length of 4: https://github.com/chinedufn/psd/blob/master/src/sections/layer_and_mask_information_section/mod.rs#L424, so all the parsed data after it are messed up.
It seems unicode string may or may not have paddings, depending on the section length and the absolute position of file cursor. References:
Just seeking to
beginning_position + additional_layer_info_len
seems to be the easiest solution.