uamp icon indicating copy to clipboard operation
uamp copied to clipboard

Failed to create image decoder with message 'unimplemented'

Open dturner opened this issue 5 years ago • 16 comments

Getting the following debug message on app startup (emulator Pixel 3A, API 29)

2020-05-14 13:14:36.381 12259-12305/com.example.android.uamp.next D/skia: --- Failed to create image decoder with message 'unimplemented'

dturner avatar May 14 '20 12:05 dturner

getting the same error everytime I do an ffmpeg

plazar99 avatar Sep 21 '20 03:09 plazar99

@plazar99 What do you mean by "do an ffmpeg"?

dturner avatar Sep 21 '20 08:09 dturner

Last night the clues led me away from ffmpeg and to the Glide that I have in recycler. The recycler pulls videos from Getty.

plazar99 avatar Sep 21 '20 13:09 plazar99

same issue here any development on this?

niektuytel avatar Nov 18 '20 13:11 niektuytel

for me this happens when converting Drawable to byte[], this did work:

public static Bitmap drawableToBitmap (Drawable drawable) {
        Bitmap bitmap = null;

        if (drawable instanceof BitmapDrawable) {
            BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
            if(bitmapDrawable.getBitmap() != null) {
                return bitmapDrawable.getBitmap();
            }
        }

        if(drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) {
            bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); // Single color bitmap will be created of 1x1 pixel
        } else {
            bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
        }

        Canvas canvas = new Canvas(bitmap);
        drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
        drawable.draw(canvas);
        return bitmap;
    }

// icon
        Drawable test = mActivity.getDrawable(R.drawable.ic_apps_black_24dp);
        Bitmap bmp = drawableToBitmap(test);
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
        byte[] byteArray = stream.toByteArray();
        bmp.recycle();




niektuytel avatar Nov 18 '20 14:11 niektuytel

Check whether latest version of Glide fixes this. If it doesn't then we should open a bug against Glide.

dturner avatar Dec 04 '20 12:12 dturner

Also getting this while developing in Dart (Flutter) with VSCode.

I get that when there's a sizing issue which causes a layout issue.

I/flutter ( 6752): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 6752): The following assertion was thrown during performLayout():
I/flutter ( 6752): RenderBox was not laid out: RenderPointerListener#00bc7 relayoutBoundary=up10 NEEDS-PAINT
I/flutter ( 6752): NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 6752): 'package:flutter/src/rendering/box.dart':
I/flutter ( 6752): Failed assertion: line 1940 pos 12: 'hasSize'
I/flutter ( 6752):
I/flutter ( 6752): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 6752): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 6752): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 6752):   https://github.com/flutter/flutter/issues/new?template=2_bug.md

casp4 avatar Apr 13 '21 01:04 casp4

Currently, getting the same error on ver 12?

  D/skia: --- Failed to create image decoder with message 'unimplemented'

  W/Glide: Load failed for null with size [0x0]
  class com.bumptech.glide.load.engine.GlideException: Received null model`

while the size of byte array is not 0

Abdelsattar avatar Aug 10 '21 10:08 Abdelsattar

We are seeing same issue

rupeshjainearnin avatar Aug 20 '21 20:08 rupeshjainearnin

+1

zeusalmighty717 avatar Sep 16 '21 12:09 zeusalmighty717

+1

StringMeUp avatar Dec 08 '21 18:12 StringMeUp

+1

hgarciaalberto avatar Jan 06 '22 18:01 hgarciaalberto

I translate the code of @niektuytel to kotlin

import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable

object BitmapTransformer {
    fun drawableToBitmap(drawable: Drawable): Bitmap {
        if(drawable is BitmapDrawable) {
            if(drawable.bitmap != null) {
                return drawable.bitmap
            }
        }
        // Single color bitmap will be created of 1x1 pixel
        val bitmap : Bitmap  =
        if(drawable.intrinsicWidth <= 0 || drawable.intrinsicHeight <= 0) {
            Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888)
        } else {
            Bitmap.createBitmap(drawable.intrinsicWidth, drawable.intrinsicHeight, Bitmap.Config.ARGB_8888)
        }

        val canvas = Canvas(bitmap)
        drawable.setBounds(0, 0, canvas.width, canvas.height);
        drawable.draw(canvas);
        return bitmap
    }
}

fllaryora avatar Jan 12 '22 23:01 fllaryora

I've found this and it may help:

val markerOption = MarkerOptions().apply {
    position(LatLng(driver.lat, driver.lng))
    icon(R.drawabel.your_drawable.toBitmapDescriptor(context))
    snippet(driver.driverId.toString())
}
mMap.addMarker(markerOption)
fun Int.toBitmapDescriptor(context: Context): BitmapDescriptor {
    val vectorDrawable = ResourcesCompat.getDrawable(context.resources, this, context.theme)
    val bitmap = vectorDrawable?.toBitmap(
        vectorDrawable.intrinsicWidth,
        vectorDrawable.intrinsicHeight,
        Bitmap.Config.ARGB_8888
    )
    return BitmapDescriptorFactory.fromBitmap(bitmap!!)
}

hgarciaalberto avatar Jan 27 '22 01:01 hgarciaalberto

same issue

mdshakibsami avatar Aug 13 '23 13:08 mdshakibsami

same issue....

aicccode avatar Aug 23 '24 03:08 aicccode