{"record":{"id":"85bf1a24a9fbcaf6","repo":"MuntashirAkon/AppManager","slug":"no-album-art-found","errorCode":null,"errorMessage":"No album art found","messagePattern":"No album art found","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/compat/ThumbnailUtilsCompat.java","lineNumber":56,"sourceCode":"     * @throws IOException If any trouble was encountered while generating or loading the thumbnail, or if\n     *                     {@link CancellationSignal#cancel()} was invoked.\n     */\n    public static @NonNull Bitmap createAudioThumbnail(@NonNull Context context, @NonNull Uri uri, @NonNull Size size,\n                                                       @Nullable CancellationSignal signal) throws IOException {\n        // Checkpoint before going deeper\n        if (signal != null) signal.throwIfCanceled();\n\n        try (MediaMetadataRetriever retriever = new MediaMetadataRetriever()) {\n            retriever.setDataSource(context, uri);\n            final byte[] raw = retriever.getEmbeddedPicture();\n            if (raw != null) {\n                Bitmap bitmap = BitmapFactory.decodeByteArray(raw, 0, raw.length);\n                return getThumbnail(bitmap, size, true);\n            }\n        } catch (RuntimeException e) {\n            throw new IOException(\"Failed to create thumbnail\", e);\n        }\n        throw new IOException(\"No album art found\");\n    }\n\n    /**\n     * Create a thumbnail for given video file.\n     * <p>\n     * This method should only be used for files that you have direct access to;\n     * if you'd like to work with media hosted outside your app, consider using\n     * {@link ContentResolver#loadThumbnail(Uri, Size, CancellationSignal)}\n     * which enables remote providers to efficiently cache and invalidate\n     * thumbnails.\n     *\n     * @param context The Context to use when resolving the video Uri.\n     * @param uri     The video file.\n     * @param size    The desired thumbnail size.\n     * @throws IOException If any trouble was encountered while generating or\n     *                     loading the thumbnail, or if\n     *                     {@link CancellationSignal#cancel()} was invoked.\n     */","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/compat/ThumbnailUtilsCompat.java#L38-L74","documentation":"Thrown by ThumbnailUtilsCompat.createAudioThumbnail when MediaMetadataRetriever.getEmbeddedPicture() returns null — the audio file simply contains no embedded artwork — or when no bitmap could be produced from it.","triggerScenarios":"Calling createAudioThumbnail on an audio file without embedded album art (raw == null), e.g. a plain WAV/FLAC stream or a stripped MP3.","commonSituations":"Media-store sweeps over folders with non-music audio (voice notes, ringtones); files whose artwork was removed by a tag editor; users expecting thumbnails for all audio files.","solutions":["Handle the IOException and display a default album-art placeholder","Pre-check getEmbeddedPicture() != null before requesting a thumbnail","Read tag metadata separately (e.g. via a tags library) and fall back to folder art or online lookup"],"exampleFix":"// before\nBitmap thumb = ThumbnailUtilsCompat.createAudioThumbnail(file, size);\n// after\nBitmap thumb;\ntry {\n    thumb = ThumbnailUtilsCompat.createAudioThumbnail(file, size);\n} catch (IOException e) {\n    thumb = defaultAlbumArt; // placeholder for files without embedded art\n}","handlingStrategy":"try-catch","validationCode":"MediaMetadataRetriever mmr = new MediaMetadataRetriever();\nmmr.setDataSource(path);\nboolean hasArt = mmr.getEmbeddedPicture() != null;\nmmr.release();\nif (!hasArt) return defaultAlbumArt;","typeGuard":null,"tryCatchPattern":"Bitmap art;\ntry {\n    art = ThumbnailUtilsCompat.createAudioThumbnail(file, size);\n} catch (IOException e) {\n    art = defaultAlbumArt; // files without embedded art are normal\n}","preventionTips":["Treat missing art as expected, not an error","Prefer pre-checking artwork presence","Provide a default artwork asset","Batch-skip tagless files during scans"],"tags":["android","thumbnail","audio","missing-artwork"],"backgroundTag":"resource-not-found","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}