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

Bitmap too large~ #121

Closed
ikkyu0319 opened this issue May 18, 2016 · 12 comments
Closed

Bitmap too large~ #121

ikkyu0319 opened this issue May 18, 2016 · 12 comments
Labels

Comments

@ikkyu0319
Copy link

ikkyu0319 commented May 18, 2016

`OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)
05-18 15:54:25.778 8210-8236/com.yalantis.ucrop.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)

05-18 15:54:25.779 8210-8236/com.yalantis.ucrop.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)

05-18 15:54:25.793 8210-8236/com.yalantis.ucrop.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)

05-18 15:54:25.794 8210-8236/com.yalantis.ucrop.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)

05-18 15:54:25.794 8210-8236/com.yalantis.ucrop.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)`

@shliama shliama added the bug label Jun 21, 2016
@shliama shliama self-assigned this Jun 21, 2016
@shliama
Copy link
Contributor

shliama commented Jun 21, 2016

Thanks for the issue. I've added fix and it will be available soon in next library update :octocat:

@shliama shliama closed this as completed Jun 21, 2016
@shliama shliama reopened this Jun 21, 2016
@ufosaga
Copy link

ufosaga commented Jul 15, 2016

Any update on this?

@shliama
Copy link
Contributor

shliama commented Jul 15, 2016

It should be fixed in 2.1.1. If you can reproduce it with the latest version, please attach image and device info so I can reproduce.

@ufosaga
Copy link

ufosaga commented Jul 16, 2016

@shliama
Hi Oleksii,
I am using the ucrop top of tree cloning yesterday by:
[email protected]:Yalantis/uCrop.git
gradle.properties shows: VERSION_NAME=2.1.1

I am able to reprodue this issue with the sample(com.yalantis.ucrop.sample) on a M4 LTE device.
Here the image and device information:
Error logs:
....
07-16 09:38:43.354 19663-19855/com.yalantis.ucrop.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)
07-16 09:38:43.371 19663-19855/com.yalantis.ucrop.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)
07-16 09:38:43.388 19663-19855/com.yalantis.ucrop.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)
....


Oops, I have problem to upload the images to s3 (blocked by the Great Fire Wall of China), I'll have a try later...

mi4let
img20160703103145

@ufosaga
Copy link

ufosaga commented Jul 19, 2016

@shliama are you able to reproduce using my test photo? Please let me know if I didn't using uCrop the right way.

@swepthong
Copy link

swepthong commented Jul 20, 2016

android:hardwareAccelerated="false"

or

Canvas canvas = new Canvas();
if(canvas.getMaximumBitmapWidth() < bitmap.getWidth() ) {
cropView.setLayerType(View.LAYER_TYPE_SOFTWARE,null);
}

@ufosaga
Copy link

ufosaga commented Jul 30, 2016

@swepthong
android:hardwareAccelerated="false" does can workaround this issue, but will largely impact the image op performance.
canvas cannot provide the correct gl texure extent limit. My modified version is:

if (bitmap.getWidth() > GL10.GL_MAX_TEXTURE_SIZE || bitmap.getHeight() > GL10.GL_MAX_TEXTURE_SIZE) {
    cv.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

@iielse
Copy link

iielse commented Aug 5, 2016

W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (4128x2322, max=4096x4096)

compile 'com.yalantis:ucrop:2.1.2'

@iielse
Copy link

iielse commented Aug 5, 2016

<activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:hardwareAccelerated="false"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

this is useful

@pit1
Copy link

pit1 commented Aug 6, 2016

X

@milan-milojevic
Copy link

The proper solution is to use UCrop.Options setMaxBitmapSize() to make sure the OpenGLRenderer texture pixel limit is not exceeded

@shliama
Copy link
Contributor

shliama commented Sep 8, 2016

Please check the latest uCrop version :octocat:
Now you can choose between:

Lightweight general solution
compile 'com.yalantis:ucrop:2.2.0' 
Get power of the native code to preserve image quality (+ about 1.5 MB to an apk size)
compile 'com.yalantis:ucrop:2.2.0-native'

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

No branches or pull requests

8 participants