#706 lift format control for tiling, allowing large DNG tiling if supported
This commit is contained in:
parent
4fada94fb6
commit
da38e4a4ed
6 changed files with 5 additions and 18 deletions
|
@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- Viewer: lift format control for tiling, allowing large DNG tiling if supported
|
||||||
- Info: strip `unlocated` filter from context collection when editing location via map
|
- Info: strip `unlocated` filter from context collection when editing location via map
|
||||||
- Slideshow: keep playing when losing focus but app is still visible (e.g. split screen)
|
- Slideshow: keep playing when losing focus but app is still visible (e.g. split screen)
|
||||||
- upgraded Flutter to stable v3.16.8
|
- upgraded Flutter to stable v3.16.8
|
||||||
|
|
|
@ -56,7 +56,6 @@ class DeviceHandler(private val context: Context) : MethodCallHandler {
|
||||||
"canUseCrypto" to (sdkInt >= Build.VERSION_CODES.LOLLIPOP),
|
"canUseCrypto" to (sdkInt >= Build.VERSION_CODES.LOLLIPOP),
|
||||||
"hasGeocoder" to Geocoder.isPresent(),
|
"hasGeocoder" to Geocoder.isPresent(),
|
||||||
"isDynamicColorAvailable" to DynamicColors.isDynamicColorAvailable(),
|
"isDynamicColorAvailable" to DynamicColors.isDynamicColorAvailable(),
|
||||||
"regionDecodableMimeTypes" to MimeTypes.supportedByBitmapRegionDecoder,
|
|
||||||
"showPinShortcutFeedback" to (sdkInt >= Build.VERSION_CODES.O),
|
"showPinShortcutFeedback" to (sdkInt >= Build.VERSION_CODES.O),
|
||||||
"supportEdgeToEdgeUIMode" to (sdkInt >= Build.VERSION_CODES.Q),
|
"supportEdgeToEdgeUIMode" to (sdkInt >= Build.VERSION_CODES.Q),
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,6 +18,9 @@ import deckers.thibault.aves.utils.StorageUtils
|
||||||
import io.flutter.plugin.common.MethodChannel
|
import io.flutter.plugin.common.MethodChannel
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
|
// As of Android 14 (API 34), `BitmapRegionDecoder` documentation states
|
||||||
|
// that "only the JPEG, PNG, WebP and HEIF formats are supported"
|
||||||
|
// but in practice it successfully decodes some others.
|
||||||
class RegionFetcher internal constructor(
|
class RegionFetcher internal constructor(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -163,13 +163,4 @@ object MimeTypes {
|
||||||
}
|
}
|
||||||
|
|
||||||
val TIFF_EXTENSION_PATTERN = Regex(".*\\.tiff?", RegexOption.IGNORE_CASE)
|
val TIFF_EXTENSION_PATTERN = Regex(".*\\.tiff?", RegexOption.IGNORE_CASE)
|
||||||
|
|
||||||
val supportedByBitmapRegionDecoder: List<String> = listOf(
|
|
||||||
// Android's `BitmapRegionDecoder` documentation states that "only the JPEG and PNG formats are supported"
|
|
||||||
// but in practice (tested on API 25, 27, 29), it successfully decodes the formats listed below,
|
|
||||||
// and it actually fails to decode GIF, DNG and animated WEBP. Other formats were not tested.
|
|
||||||
HEIC, HEIF, JPEG, PNG, WEBP, ARW, CR2, NEF, NRW, ORF, PEF, RAF, RW2, SRW,
|
|
||||||
// custom support
|
|
||||||
TIFF,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ class Device {
|
||||||
late final bool _canAuthenticateUser, _canGrantDirectoryAccess, _canPinShortcut;
|
late final bool _canAuthenticateUser, _canGrantDirectoryAccess, _canPinShortcut;
|
||||||
late final bool _canRenderFlagEmojis, _canRenderSubdivisionFlagEmojis, _canRequestManageMedia, _canSetLockScreenWallpaper, _canUseCrypto;
|
late final bool _canRenderFlagEmojis, _canRenderSubdivisionFlagEmojis, _canRequestManageMedia, _canSetLockScreenWallpaper, _canUseCrypto;
|
||||||
late final bool _hasGeocoder, _isDynamicColorAvailable, _isTelevision, _showPinShortcutFeedback, _supportEdgeToEdgeUIMode, _supportPictureInPicture;
|
late final bool _hasGeocoder, _isDynamicColorAvailable, _isTelevision, _showPinShortcutFeedback, _supportEdgeToEdgeUIMode, _supportPictureInPicture;
|
||||||
late final List<String> _regionDecodableMimeTypes;
|
|
||||||
|
|
||||||
String get packageName => _packageName;
|
String get packageName => _packageName;
|
||||||
|
|
||||||
|
@ -50,8 +49,6 @@ class Device {
|
||||||
|
|
||||||
bool get supportPictureInPicture => _supportPictureInPicture;
|
bool get supportPictureInPicture => _supportPictureInPicture;
|
||||||
|
|
||||||
bool canDecodeRegion(String mimeType) => _regionDecodableMimeTypes.contains(mimeType);
|
|
||||||
|
|
||||||
Device._private();
|
Device._private();
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
|
@ -85,7 +82,6 @@ class Device {
|
||||||
_canUseCrypto = capabilities['canUseCrypto'] ?? false;
|
_canUseCrypto = capabilities['canUseCrypto'] ?? false;
|
||||||
_hasGeocoder = capabilities['hasGeocoder'] ?? false;
|
_hasGeocoder = capabilities['hasGeocoder'] ?? false;
|
||||||
_isDynamicColorAvailable = capabilities['isDynamicColorAvailable'] ?? false;
|
_isDynamicColorAvailable = capabilities['isDynamicColorAvailable'] ?? false;
|
||||||
_regionDecodableMimeTypes = (capabilities['regionDecodableMimeTypes'] ?? []).cast<String>();
|
|
||||||
_showPinShortcutFeedback = capabilities['showPinShortcutFeedback'] ?? false;
|
_showPinShortcutFeedback = capabilities['showPinShortcutFeedback'] ?? false;
|
||||||
_supportEdgeToEdgeUIMode = capabilities['supportEdgeToEdgeUIMode'] ?? false;
|
_supportEdgeToEdgeUIMode = capabilities['supportEdgeToEdgeUIMode'] ?? false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:io';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:aves/model/app/support.dart';
|
import 'package:aves/model/app/support.dart';
|
||||||
import 'package:aves/model/device.dart';
|
|
||||||
import 'package:aves/model/entry/entry.dart';
|
import 'package:aves/model/entry/entry.dart';
|
||||||
import 'package:aves/model/settings/settings.dart';
|
import 'package:aves/model/settings/settings.dart';
|
||||||
import 'package:aves/model/source/trash.dart';
|
import 'package:aves/model/source/trash.dart';
|
||||||
|
@ -33,7 +32,7 @@ extension ExtraAvesEntryProps on AvesEntry {
|
||||||
|
|
||||||
// size
|
// size
|
||||||
|
|
||||||
bool get useTiles => canDecodeRegion && (width > 4096 || height > 4096);
|
bool get useTiles => (width > 4096 || height > 4096) && !isAnimated;
|
||||||
|
|
||||||
bool get isSized => width > 0 && height > 0;
|
bool get isSized => width > 0 && height > 0;
|
||||||
|
|
||||||
|
@ -128,8 +127,6 @@ extension ExtraAvesEntryProps on AvesEntry {
|
||||||
|
|
||||||
bool get canDecode => AppSupport.canDecode(mimeType);
|
bool get canDecode => AppSupport.canDecode(mimeType);
|
||||||
|
|
||||||
bool get canDecodeRegion => device.canDecodeRegion(mimeType) && !isAnimated;
|
|
||||||
|
|
||||||
bool get canEditExif => AppSupport.canEditExif(mimeType);
|
bool get canEditExif => AppSupport.canEditExif(mimeType);
|
||||||
|
|
||||||
bool get canEditIptc => AppSupport.canEditIptc(mimeType);
|
bool get canEditIptc => AppSupport.canEditIptc(mimeType);
|
||||||
|
|
Loading…
Reference in a new issue