Comments (6)
Hi, @eduardhasanaj2
First of all, you should know where it takes the time.
Open the directory ./unimgpicker_android
with AndroidStudio. It's an Android native app project.
You can run it as an Android app in your device.
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.
Then you can place break points like when you develop on Android and investigate it more deeply.
Thank you.
from unimgpicker.
I found this last night. Bitmap.compress is the evil there. it can take from 2 sec to 3 or more.
Definitely we need that task to be performed in gpu rather than cpu. I have something but i do not know if you will like and implement also in ios version (am completely noob here). The idea is to create an OpenGL Texture and pass it to unity.
Let me some time to report back.
Best wishes.
from unimgpicker.
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...
I feel appreciate if you try it.
Thank you.
from unimgpicker.
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?
I think that if we can pass opengl texture to unity we can have a good result. The problem is that I do not know c++. I have done something to create texture but i couldnt find a way to properly pass opengl context to unity. To have a generic code we need the c++ code so we can get the context properly.
I will tryy what you said and perhaps we can get a good result
from unimgpicker.
Hey I tried and I am enjoying amazing results when we use opengl. From 1960 it drop to 16 mills ! WTF!
here is a sample app https://ufile.io/3aed4
now we have just to do another version using opengles20.
from unimgpicker.
Did you test it?
from unimgpicker.
Related Issues (20)
- Unity 2018.3.0b5 Android Gradle Build Failed HOT 5
- Doesn't work with WebGL HOT 2
- Build with the latest Unity HOT 2
- Unimgpicker doesn't work when i push the button HOT 2
- unable to upload videos. I have modified the code and made the system work with videos, but the uimgpicker does not show videos when im trying to upload. Where can i change this setting.
- Not Working In Mobile
- Gradle error when build for android
- How to check image orientation of image HOT 4
- Problem with Unimgpicker HOT 3
- Handling of IllegalArgumentException
- How do we crop the image ? HOT 3
- can we make two cube and then ........... HOT 5
- Doesn't work on IOS device HOT 2
- リサイズ機能を戻して欲しい+Windows対応しました HOT 4
- Cancel response
- Alternative to using delgate to get URL HOT 1
- Image Picker: NullReferenceException
- How to make the orientation of img picker scene become landscape left?
- How can I use this to apply on an image instead of a mesh renderer? HOT 1
- How to get size before compression of image in android environment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unimgpicker.