-
Notifications
You must be signed in to change notification settings - Fork 48
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
Too slow Image loading #10
Comments
Hi, @eduardhasanaj2 First of all, you should know where it takes the time. Open the directory A small app will launch. It loads image using unimgpicker plugin when the button "Show Picker" is pressed, and reads the picked image with the "Reload Image" button. (FYI, You have to press the reload button because this app can not hook the UnitySendMessage callbacks) If it still takes the time, I guess the problem is in the plugin. Thank you. |
I found this last night. Bitmap.compress is the evil there. it can take from 2 sec to 3 or more. |
Thanks for the report. That's a very helpful feedback! I think depending on OpenGL is not a good idea. Since there is a possibility that a developer choose to use Metal in iOS. Instead of that, I have a small idea. What about if we use JPEG to the output format. image.compress(Bitmap.CompressFormat.JPEG, 100, outputStream); On my device (Nexus 5 with Android 6.0.1), it reduces the compression time in about 1 sec. I could not feel much difference because the original code (to compress it into PNG) did not take much time on the device. I'm sorry that I don't have Galaxy phones nor Android 7.x devices... Thank you. |
Hmmm I think the total time from when user click to displaying texture in unity should be around 1 sec both. Greater than that I think it is not good. Am i exaggerating? |
Hey I tried and I am enjoying amazing results when we use opengl. From 1960 it drop to 16 mills ! WTF! |
Did you test it? |
Hi,
I am having a strange bug with a modified version of plugin. After fixing rotation (didnt test before) In a Galaxy tab A t 580 sometimes it loads the image in 8b seconds sometime in 4, but sometimes it loads them fast. In other tablet worst than this one but with android < 7 works fine. I compiled the plugin with sdk target 25 so why can be this issue. I do not know where to start. Please give me a fast response? Could this be an issue in unity side?
Here is code that I use:
#9
Other important thing.
I tried to close area of searching the bug. When we load the image that is landscape there is no code or need to rotate (if i is 180 we need but mostly in my device it is 270 for portrait photos (in problematic device I hadnt chance to test)). So it should work with official version of your plugin (only exif analysis). But the tester report the same time. There is no difference between portrait and landscape. I am definitively gone!
The text was updated successfully, but these errors were encountered: