Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Add support for slices v7 and v8 #36

Merged
merged 4 commits into from
Aug 16, 2022

Conversation

scoiatael
Copy link
Contributor

@scoiatael scoiatael commented Jul 7, 2022

Hey,

Looks like newer (Adobe Photoshop CS and later) format for slices is not supported - https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_19931

This PR adds that support :)

TODO:

  • Simplify test fixture file - right now it's 14MBs, a little much for Git repo.

@chinedufn
Copy link
Owner

Looks great thanks for putting this together!

Can merge as soon as we replace that big PSD fixture with a small one.

@scoiatael scoiatael marked this pull request as ready for review July 26, 2022 15:11
@scoiatael
Copy link
Contributor Author

Managed to simplify the file down to 1MB - I honestly don't know why it's that much - it's essentially empty file. But looks like tests pass so we should be good to go :)

@chinedufn
Copy link
Owner

chinedufn commented Jul 27, 2022

Thanks for putting this together!

Right now it looks like our biggest PSD test fixture is under 25KB.

I don't have access to Photoshop at the moment to try to make a smaller one... Are you making this using Photoshop or some other program? Is your file small (i.e. less than 9x9) or is it larger?

Hopefully we can get this to a more reasonable size. Having one file that's 1Mb won't be too terrible I suppose.. just trying to see if we can avoid opening up our doors for big files..

Or is it fundamentally impossible to shrink this fixture any further for some reason?

Thanks!

@scoiatael
Copy link
Contributor Author

Hm. I used Photoshop to avoid artificially creating something that you won't stumble upon in the wild :)
The problem is that I'm not that proficient in PS to really know what is represented by this slice - essentially I was removing parts of design as long as the this library was complaining about slice version not being supported. And there ain't much left.

Sadly I'm running out of time allocated for work here. We can simply wait with this PR until you have access to PS. Or we could use Git LFS for fixtures? Looks like Github allocates 1GB per account: https://docs.github.com/en/billing/managing-billing-for-git-large-file-storage/about-billing-for-git-large-file-storage

@chinedufn
Copy link
Owner

Awesome, yeah we've used Photoshop for all of the other fixtures.

I'll get access to Photoshop and mess around with this.

Since our fixtures don't ever change a 1MB file isn't too bad.. so if I can't get it smaller I'll land this.

Thanks!

@chinedufn
Copy link
Owner

Hey before I mess with Photoshop, can you confirm that you tried resizing the PSD file to 1x1? Thanks!

@scoiatael
Copy link
Contributor Author

Hey, sorry for not answering for a long time - managed to learn a couple of tricks in PS and now the size is 24K :)

@chinedufn
Copy link
Owner

Awesome!!!

@chinedufn chinedufn merged commit 985bbdc into chinedufn:master Aug 16, 2022
@chinedufn
Copy link
Owner

chinedufn commented Aug 16, 2022

Published to crates.io as 0.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants