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

API Async methods sometimes fail to return texture object #2

Open
andrew-raphael-lukasik opened this issue Apr 3, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@andrew-raphael-lukasik
Copy link
Owner

You may want to stay away from async calls until this is solved. Because these methods sometimes return null. Any info and repro steps on this will be highly appreciated

@andrew-raphael-lukasik andrew-raphael-lukasik added the bug Something isn't working label Apr 3, 2019
@ddutchie
Copy link

ddutchie commented Apr 5, 2019

Async Saving does not work for me

texture.isReadable is only available on main thread
texture GetDataWidth also.

Keen to see where this goes. Having issues saving massive textures on mobile.

@andrew-raphael-lukasik
Copy link
Owner Author

Thanks @ddutchie for reporting this. Fortunately it's really easy to fix and caused by just silly mistake on my part I didn't pickup earlier. Well and it shows why unit testing is a really good idea for these kind of projects.

@aidanwolf
Copy link

Also having this issue. Did async calls ever work?

@aidanwolf
Copy link

According to my tests, Read/Write with pngcs are 1.6x slower than using Unity's EncodeToPNG() and LoadImage().

@andrew-raphael-lukasik
Copy link
Owner Author

Hi @aidanwolf. PNGCS is slower because it's designed for "huge images, which one does not want to load fully in memory" (original readme.txt), ie. memory conservation rather than speed. PNGCS realises this goal reading images line by line, and decoding data line by line. But this behaviour can be modified to regain speed

@andrew-raphael-lukasik
Copy link
Owner Author

andrew-raphael-lukasik commented Aug 7, 2019

Also having this issue. Did async calls ever work?

Yes BUT there is a bug somewhere and I can't figure out what it is exactly.
I can reproduce it always happening on 1st program execution after editor is (re)started and works fine after that. I tried to figure out what is happening on several occasion but no results so far. I even contacted Unity support with this issue but yet to receive answer from them.
If you guys happen to notice any code-smell or have any leads for this issue please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants