diff --git a/CHANGELOG.md b/CHANGELOG.md index 82003e315..9a09a0acc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] -## [v1.7.3] - 2022-11-11 +## [v1.7.4] - 2022-11-11 ### Added @@ -28,6 +28,8 @@ All notable changes to this project will be documented in this file. - launch crash on Android KitKat - ExifInterface: producing invalid WebP files +## [v1.7.3] - 2022-11-11 [YANKED AGAIN!] + ## [v1.7.2] - 2022-11-11 [YANKED] ## [v1.7.1] - 2022-10-09 diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DebugHandler.kt b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DebugHandler.kt index 9135f9430..12f098cbf 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DebugHandler.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DebugHandler.kt @@ -41,8 +41,11 @@ import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import org.beyka.tiffbitmapfactory.TiffBitmapFactory import org.mp4parser.IsoFile +import org.mp4parser.PropertyBoxParserImpl +import org.mp4parser.boxes.iso14496.part12.MediaDataBox +import org.mp4parser.boxes.iso14496.part12.SampleTableBox +import java.io.FileInputStream import java.io.IOException -import java.nio.channels.Channels class DebugHandler(private val context: Context) : MethodCallHandler { private val ioScope = CoroutineScope(SupervisorJob() + Dispatchers.IO) @@ -335,10 +338,19 @@ class DebugHandler(private val context: Context) : MethodCallHandler { val sb = StringBuilder() if (mimeType == MimeTypes.MP4) { try { - StorageUtils.openInputStream(context, uri)?.use { input -> - Channels.newChannel(input).use { channel -> - IsoFile(channel).use { isoFile -> - isoFile.dumpBoxes(sb) + // we can skip uninteresting boxes with a seekable data source + val pfd = StorageUtils.openInputFileDescriptor(context, uri) ?: throw Exception("failed to open file descriptor for uri=$uri") + pfd.use { + FileInputStream(it.fileDescriptor).use { stream -> + stream.channel.use { channel -> + val boxParser = PropertyBoxParserImpl().apply { + // parsing `MediaDataBox` can take a long time + // parsing `SampleTableBox` may yield OOM + skippingBoxes(MediaDataBox.TYPE, SampleTableBox.TYPE) + } + IsoFile(channel, boxParser).use { isoFile -> + isoFile.dumpBoxes(sb) + } } } } diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/Mp4ParserHelper.kt b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/Mp4ParserHelper.kt index d9cd24c6e..c479e8b4c 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/Mp4ParserHelper.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/Mp4ParserHelper.kt @@ -22,6 +22,8 @@ object Mp4ParserHelper { FileInputStream(it.fileDescriptor).use { stream -> stream.channel.use { channel -> val boxParser = PropertyBoxParserImpl().apply { + // parsing `MediaDataBox` can take a long time + // do not skip anything inside `MovieBox` as it will be parsed and rewritten for editing skippingBoxes(MediaDataBox.TYPE) } // creating `IsoFile` with a `File` or a `File.inputStream()` yields `No such device` diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/XMP.kt b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/XMP.kt index 55596ed03..4eeab81f4 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/XMP.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/XMP.kt @@ -23,6 +23,7 @@ import org.mp4parser.IsoFile import org.mp4parser.PropertyBoxParserImpl import org.mp4parser.boxes.UserBox import org.mp4parser.boxes.iso14496.part12.MediaDataBox +import org.mp4parser.boxes.iso14496.part12.SampleTableBox import java.io.FileInputStream import java.util.* @@ -142,7 +143,9 @@ object XMP { FileInputStream(it.fileDescriptor).use { stream -> stream.channel.use { channel -> val boxParser = PropertyBoxParserImpl().apply { - skippingBoxes(MediaDataBox.TYPE) + // parsing `MediaDataBox` can take a long time + // parsing `SampleTableBox` may yield OOM + skippingBoxes(MediaDataBox.TYPE, SampleTableBox.TYPE) } // creating `IsoFile` with a `File` or a `File.inputStream()` yields `No such device` IsoFile(channel, boxParser).use { isoFile -> 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 9976f44b6..dd06a2e0c 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 @@ -597,8 +597,10 @@ abstract class ImageProvider { mimeType = mimeType, uri = uri, path = path, - // do not truncate - mode = "w", + // do not truncate with "t" + // "w" is enough on API 29+, but it will yield an empty file on API <29 + // so "r" is necessary for backward compatibility + mode = "rw", ) ?: throw Exception("failed to open file descriptor for uri=$uri path=$path") pfd.use { FileOutputStream(it.fileDescriptor).use { outputStream -> diff --git a/fastlane/metadata/android/en-US/changelogs/1084.txt b/fastlane/metadata/android/en-US/changelogs/1084.txt new file mode 100644 index 000000000..b434e87d9 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/1084.txt @@ -0,0 +1,5 @@ +In v1.7.4: +- tag your MP4, rate your MP4, date your MP4, locate your MP4, rotate your MP4 +- give media management access (on Android 12+) to skip some confirmation dialogs +- enjoy higher quality thumbnails +Full changelog available on GitHub \ No newline at end of file diff --git a/lib/model/entry.dart b/lib/model/entry.dart index c42f47af2..0be186e26 100644 --- a/lib/model/entry.dart +++ b/lib/model/entry.dart @@ -748,7 +748,7 @@ class AvesEntry { bool get isBurst => burstEntries?.isNotEmpty == true; - // for backwards compatibility + // for backward compatibility bool get _isMotionPhotoLegacy => isMultiPage && !isBurst && mimeType == MimeTypes.jpeg; bool get isMotionPhoto => (_catalogMetadata?.isMotionPhoto ?? false) || _isMotionPhotoLegacy; diff --git a/lib/widgets/settings/settings_page.dart b/lib/widgets/settings/settings_page.dart index 52e17402f..2a877e7fc 100644 --- a/lib/widgets/settings/settings_page.dart +++ b/lib/widgets/settings/settings_page.dart @@ -182,7 +182,7 @@ class _SettingsPageState extends State with FeedbackMixin { final version = allJsonMap[exportVersionKey]; final importable = {}; if (version == null) { - // backwards compatibility before versioning + // backward compatibility before versioning importable[AppExportItem.settings] = allJsonMap; } else { if (allJsonMap is! Map) { diff --git a/pubspec.yaml b/pubspec.yaml index 7a1d1c2e4..1b366eacd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/deckerst/aves # - github changelog: /CHANGELOG.md # - play changelog: /whatsnew/whatsnew-en-US # - izzy changelog: /fastlane/metadata/android/en-US/changelogs/1XXX.txt -version: 1.7.3+83 +version: 1.7.4+84 publish_to: none environment: diff --git a/whatsnew/whatsnew-en-US b/whatsnew/whatsnew-en-US index b9b547a16..b434e87d9 100644 --- a/whatsnew/whatsnew-en-US +++ b/whatsnew/whatsnew-en-US @@ -1,4 +1,4 @@ -In v1.7.3: +In v1.7.4: - tag your MP4, rate your MP4, date your MP4, locate your MP4, rotate your MP4 - give media management access (on Android 12+) to skip some confirmation dialogs - enjoy higher quality thumbnails