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

Image is Sometime uploading and sometime it throws an error #2801

Closed
younas-bangash opened this issue Jan 10, 2018 · 4 comments
Closed

Image is Sometime uploading and sometime it throws an error #2801

younas-bangash opened this issue Jan 10, 2018 · 4 comments

Comments

@younas-bangash
Copy link

younas-bangash commented Jan 10, 2018

Glide Version:
implementation 'com.github.bumptech.glide:glide:4.5.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'

Integration libraries:

Device/Android Version:
6.0.0

Issue details / Repro steps / Use case background:

Glide load line / GlideModule (if any) / list Adapter code (if any):

 Glide.with(getApplicationContext())
                                    .load(json.getString("agent_profile_pic"))
                                    .apply(RequestOptions
                                            .circleCropTransform()
                                            .diskCacheStrategy(DiskCacheStrategy.NONE)
                                            .skipMemoryCache(true))
                                    .listener(new RequestListener<Drawable>() {
                                        @Override
                                        public boolean onLoadFailed(@Nullable GlideException e,
                                                                    Object model, Target<Drawable>
                                                                            target,
                                                                    boolean isFirstResource) {
                                            Log.d(TAG, "onLoadFailed() called with: e = [" + e + "]," +
                                                    " model = [" + model + "], target = [" +
                                                    target + "], isFirstResource = [" + isFirstResource + "]");
                                            profilePic.setImageResource(R.mipmap.ic_launcher);
                                            updateProfileBinding.progressBar.setVisibility(View.GONE);
                                            return false;
                                        }

                                        @Override
                                        public boolean onResourceReady(Drawable resource, Object model,
                                                                       Target<Drawable> target,
                                                                       DataSource dataSource,
                                                                       boolean isFirstResource) {
                                            updateProfileBinding.progressBar.setVisibility(View.GONE);
                                            return false;
                                        }
                                    })
                                    .into(profilePic);

Layout XML:

 <RelativeLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_marginTop="16dp">

                        <ProgressBar
                            android:id="@+id/progress"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_centerInParent="true"
                            android:theme="@style/AppTheme"
                            android:visibility="visible" />

                        <ImageView
                            android:id="@+id/profilePic"
                            android:layout_width="132dp"
                            android:layout_height="132dp" />

                    </RelativeLayout>

Stack trace / LogCat:

Load failed for [link of an image ] with size [396x396]
                                                             class com.bumptech.glide.load.engine.GlideException: Failed to load resource
                                                             There were 3 causes:
                                                             java.io.IOException(Exception decoding bitmap, outWidth: 1080, outHeight: 979, outMimeType: image/jpeg, inBitmap: [396x359] ARGB_8888 (568656))
                                                             com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream$InvalidMarkException(Mark has been invalidated, pos: 16384 markLimit: 65536)
                                                             java.io.FileNotFoundException(No content provider: [link of an image ])
                                                              call GlideException#logRootCauses(String) for more detail
                                                               Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ContentLengthInputStream->Object->Drawable}, REMOTE
                                                             There were 2 causes:
                                                             java.io.IOException(Exception decoding bitmap, outWidth: 1080, outHeight: 979, outMimeType: image/jpeg, inBitmap: [396x359] ARGB_8888 (568656))
                                                             com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream$InvalidMarkException(Mark has been invalidated, pos: 16384 markLimit: 65536)
                                                              call GlideException#logRootCauses(String) for more detail
                                                                 Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ContentLengthInputStream->GifDrawable->Drawable}
                                                                 Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ContentLengthInputStream->Bitmap->Drawable}
                                                             There was 1 cause:
                                                             java.io.IOException(Exception decoding bitmap, outWidth: 1080, outHeight: 979, outMimeType: image/jpeg, inBitmap: [396x359] ARGB_8888 (568656))
                                                              call GlideException#logRootCauses(String) for more detail
                                                                   Cause (1 of 1): class java.io.IOException: Exception decoding bitmap, outWidth: 1080, outHeight: 979, outMimeType: image/jpeg, inBitmap: [396x359] ARGB_8888 (568656)
                                                                 Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ContentLengthInputStream->BitmapDrawable->Drawable}
                                                             There was 1 cause:
                                                             com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream$InvalidMarkException(Mark has been invalidated, pos: 16384 markLimit: 65536)
                                                              call GlideException#logRootCauses(String) for more detail
                                                                   Cause (1 of 1): class com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream$InvalidMarkException: Mark has been invalidated, pos: 16384 markLimit: 65536
                                                               Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.content.res.AssetFileDescriptor, LOCAL
                                                             There was 1 cause:
                                                             java.io.FileNotFoundException(No content provider:  [link of an image ])
                                                              call GlideException#logRootCauses(String) for more detail
                                                                 Cause (1 of 1): class java.io.FileNotFoundException: No content provider:  [link of an image ]
@sjudd
Copy link
Collaborator

sjudd commented Jan 10, 2018

Can you attach a failing test case that demonstrates the issue? Or a sample image that you can reproduce this with?

@younas-bangash
Copy link
Author

That issue is not like it appear everytime it depends, sometimes it work properly and sometimes I received that error so I have no option to switch to another library because I can not trust it

@sjudd
Copy link
Collaborator

sjudd commented Jan 12, 2018

Ok if you get the chance to add a failing image or a sample app or a test case, let me know and we'll look in to it.

@sjudd sjudd closed this as completed Jan 12, 2018
@younas-bangash
Copy link
Author

I told you it is not some sort of like crashing on everytime it sometime work and sometime crash

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

No branches or pull requests

2 participants