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

9 Patch - Right Indicator (Content Height Padding) on XXHDPI and XXXHDPI is in #010101 instead of #000000 #196

Closed
taylorling opened this issue Jan 17, 2019 · 13 comments

Comments

@taylorling
Copy link

Just wanted to file this because we found this issue when the dev having issue importing them into AS for XX and XXX, and turns out the the right indicator line is in #010101 so AS is complaining missing border/wrong color.

@taylorling taylorling changed the title Right Indicator (Content Height Padding) on XXHDPI and XXXHDPI is in #010101 instead of #000000 9 Patch - Right Indicator (Content Height Padding) on XXHDPI and XXXHDPI is in #010101 instead of #000000 Jan 17, 2019
@romannurik
Copy link
Owner

The only thing I can think of is the canvas toDataURL call needs to be more specific w.r.t specifying an output quality (i.e. it should be toDataURL('image/png', 1.0) instead of just toDataURL. Taylor (hi!!!) if you or an engineer you know have bandwidth to try making that change yourself, please give it a go! Otherwise I can hopefully find some time soon to try it.

@taylorling
Copy link
Author

Hey Roman (it's been a while 👋 ) - no rush, just thought to file this so if someone having the same issue, they are aware of the issue, and make changes manually.

romannurik added a commit that referenced this issue Jan 22, 2019
Attempt fixing #196 by forcing nine patch PNGs to 100% quality
@romannurik
Copy link
Owner

I just pushed the change, but not sure if it'll fix it. In case it doesn't, mind sharing a set of repro steps (e.g. with an example source PNG file) so I can try to reproduce the problem?

@romannurik
Copy link
Owner

OK this should be fully fixed by a4ddd69

@taylorling
Copy link
Author

@romannurik Hey buddy, I just give it a try and I still have the same issue.

Here's the source file I used: https://www.dropbox.com/s/xzv60k57mxy53da/btn-blue.png?dl=0

And here's the output zip that I got: https://www.dropbox.com/s/18bgpj25mmjjgc2/btn_blue.9.zip?dl=0

What I did is simply auto stretch, trimming, setting content padding and optical bound, then export. You can see in xxxhdpi, the right indicator is in #010101.

@romannurik
Copy link
Owner

Hrmmmmm, ok. Will re-open and investigate when I get a chance.

@romannurik romannurik reopened this Jan 23, 2019
@romannurik
Copy link
Owner

Hm, Photoshop is showing RGB 0,0,0 for the xxxhdpi right indicator (content padding). Did i mix something up?

@taylorling
Copy link
Author

taylorling commented Jan 24, 2019

With my 9-patches? If I use Sketch eyedropper on the xxxhdpi asset, it shows me #010101 or RGB 1,1,1 (attached below). If you try to import this asset into AS, it will prompt you that there is a missing color, so it's likely not #000000.

To make sure I didn't inspect the wrong asset, I just ran a fresh generation using the tool again, and it still give me the same result.

screenshot 2019-01-24 at 10 10 25 am

@taylorling
Copy link
Author

I just tried it on Photoshop and it's indeed showing 0,0,0 and I think it's not correct - if you use the Mac's Digital Color Meter, you can see that it's not entirely 0,0,0 - strange.

@romannurik
Copy link
Owner

Whoa, super weird. I'll take a look and see if I can fix the problem in Sketch :)

@romannurik
Copy link
Owner

Finally reproduced the problem... so weird that Photoshop shows 0,0,0.

@romannurik
Copy link
Owner

OK, the problem is alpha=254, not alpha=255, hence why Photoshop shows 0,0,0. Looking into it

@romannurik
Copy link
Owner

Should be fixed now.

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

No branches or pull requests

2 participants