diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f2fd27f2..1b9f87715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Fixed + +- editing some WEBP corrupting them (by failing instead) + ## [v1.9.0] - 2023-08-21 ### Added @@ -24,6 +28,7 @@ All notable changes to this project will be documented in this file. ### Fixed - flickering when starting videos +- editing fragmented MP4 corrupting them (by failing instead) ## [v1.8.9] - 2023-06-04 diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/model/provider/ImageProvider.kt b/android/app/src/main/kotlin/deckers/thibault/aves/model/provider/ImageProvider.kt index ac1624c5b..e73b2326f 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/model/provider/ImageProvider.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/model/provider/ImageProvider.kt @@ -6,6 +6,7 @@ import android.content.ContextWrapper import android.content.Intent import android.content.pm.PackageManager import android.graphics.Bitmap +import android.graphics.ImageDecoder import android.net.Uri import android.os.Binder import android.os.Build @@ -684,6 +685,14 @@ abstract class ImageProvider { throw Exception("editing Exif changes mimeType=$mimeType -> $editedMimeType for uri=$uri path=$path") } + if (mimeType == MimeTypes.WEBP && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + // as of androidx.exifinterface:exifinterface:1.3.6, editing some specific WEBP + // makes them undecodable by some decoders (including Android's and Chrome's) + // even though `BitmapFactory` successfully decodes their bounds, + // so we check whether decoding it throws an exception + ImageDecoder.decodeBitmap(ImageDecoder.createSource(editableFile)) + } + if (videoBytes != null) { // append trailer video, if any editableFile.appendBytes(videoBytes!!) diff --git a/android/build.gradle b/android/build.gradle index fd0f3742e..10ae183fd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,7 +3,7 @@ buildscript { kotlin_version = '1.8.21' ksp_version = "$kotlin_version-1.0.11" agp_version = '7.4.2' - glide_version = '4.15.1' + glide_version = '4.16.0' // AppGallery Connect plugin versions: https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-sdk-changenotes-0000001058732550 huawei_agconnect_version = '1.9.1.300' abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4] @@ -28,7 +28,7 @@ buildscript { if (useCrashlytics) { // GMS & Firebase Crashlytics (used by some flavors only) classpath 'com.google.gms:google-services:4.3.15' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.8' } if (useHms) {