multipage: hide gain map page from ultra HDR images

This commit is contained in:
Thibault Deckers 2023-12-21 18:46:50 +01:00
parent 72a6af5040
commit f5e7b5275f
3 changed files with 6 additions and 8 deletions

View file

@ -7,12 +7,14 @@ import 'package:aves/services/common/services.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
extension ExtraAvesEntryMultipage on AvesEntry { extension ExtraAvesEntryMultipage on AvesEntry {
bool get isMultiPage => (catalogMetadata?.isMultiPage ?? false) || isBurst; bool get isMultiPage => isBurst || ((catalogMetadata?.isMultiPage ?? false) && (isMotionPhoto || !isHdr));
bool get isBurst => burstEntries?.isNotEmpty == true; bool get isBurst => burstEntries?.isNotEmpty == true;
bool get isMotionPhoto => catalogMetadata?.isMotionPhoto ?? false; bool get isMotionPhoto => catalogMetadata?.isMotionPhoto ?? false;
bool get isHdr => catalogMetadata?.hasHdrGainMap ?? false;
String? getBurstKey(List<String> patterns) { String? getBurstKey(List<String> patterns) {
final key = BurstPatterns.getKeyForName(filenameWithoutExtension, patterns); final key = BurstPatterns.getKeyForName(filenameWithoutExtension, patterns);
return key != null ? '$directory/$key' : null; return key != null ? '$directory/$key' : null;

View file

@ -74,8 +74,6 @@ extension ExtraAvesEntryProps on AvesEntry {
bool get is360 => catalogMetadata?.is360 ?? false; bool get is360 => catalogMetadata?.is360 ?? false;
bool get isHdr => (catalogMetadata?.hasHdrGainMap ?? false);
// trash // trash
bool get isExpiredTrash { bool get isExpiredTrash {

View file

@ -97,11 +97,9 @@ class GridThemeData {
if (entry.isRaw && showRaw) const RawIcon(), if (entry.isRaw && showRaw) const RawIcon(),
if (entry.is360) const PanoramaIcon(), if (entry.is360) const PanoramaIcon(),
], ],
if (entry.isMultiPage) ...[
if (entry.isHdr) const HdrIcon(), if (entry.isHdr) const HdrIcon(),
if (entry.isMotionPhoto && showMotionPhoto) const MotionPhotoIcon(), if (entry.isMotionPhoto && showMotionPhoto) const MotionPhotoIcon(),
if (!entry.isHdr && !entry.isMotionPhoto) MultiPageIcon(entry: entry), if (entry.isMultiPage && !entry.isMotionPhoto) MultiPageIcon(entry: entry),
],
if (entry.isGeotiff) const GeoTiffIcon(), if (entry.isGeotiff) const GeoTiffIcon(),
if (entry.trashed && showTrash) TrashIcon(trashDaysLeft: entry.trashDaysLeft), if (entry.trashed && showTrash) TrashIcon(trashDaysLeft: entry.trashDaysLeft),
]; ];