chinedufn / psd

A Rust API for parsing and working with PSD files.
https://chinedufn.github.io/psd
Apache License 2.0
265 stars 40 forks source link

Fix #17, remove padding #18

Closed tdakkota closed 4 years ago

tdakkota commented 4 years ago

I did a little investigation, the problem was at padding. So, fifteen_letters test passes. But I think we should add more tests.

PSD specification does not give a lot information about string field padding.

chinedufn commented 4 years ago

Ah nice!

Now that I think about it ... This seems like it might work for 15 but then break for other numbers.

Seems like we should add psd fixtures in fixtures/slices-resource named:

1.psd
12.psd
123.psd
1234.psd
12345.psd
123456.psd
1234567.psd
12345678.psd
123456789.psd
1234567890.psd
12345678901.psd
123456789012.psd
1234567890123.psd
12345678901235.psd
123456789012356.psd

And then have the slices resource format test parse all of them.

chinedufn commented 4 years ago

One thing I noticed is that the slice name is based on the name that you create the PSD file with. So we can't just create one PSD and copy it with different names. Have to go through by hand and make 16 new PSD files

I'm happy to make all of these since it's a hassle! Just lmk!

chinedufn commented 4 years ago

Actually - what i think we should really test for is the name of the slice group (which we don't currently expose) but I merged in as _group_of_slices_name

So maybe we expose that somehow so that the test can verify that the name matches the filename (1, 12, etc)

Or do you have any other ideas / better about this .. ?

chinedufn commented 4 years ago

@tdakkota thanks for finding the issue here!

I'm closing this in favor of #19 where I've borrowed your solution and improved the tests as you suggested.