avif: fixed decoding of rotated still, fixed sizing during cataloguing
info: show avif metadata via exifinterface
This commit is contained in:
parent
ad214b3f56
commit
039de32faa
2 changed files with 14 additions and 5 deletions
|
@ -99,9 +99,12 @@ object MimeTypes {
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
|
|
||||||
// as of `ExifInterface` v1.3.1, `isSupportedMimeType` reports
|
// as of `ExifInterface` v1.4.0-alpha01, `isSupportedMimeType` reports
|
||||||
// no support for TIFF images, but it can actually open them (maybe other formats too)
|
// no support for AVIF/TIFF images, but it can actually open them (maybe other formats too)
|
||||||
fun canReadWithExifInterface(mimeType: String, strict: Boolean = true) = ExifInterface.isSupportedMimeType(mimeType) || !strict
|
fun canReadWithExifInterface(mimeType: String, strict: Boolean = true): Boolean {
|
||||||
|
if (!strict) return true
|
||||||
|
return ExifInterface.isSupportedMimeType(mimeType) || mimeType == AVIF
|
||||||
|
}
|
||||||
|
|
||||||
// as of latest PixyMeta
|
// as of latest PixyMeta
|
||||||
fun canReadWithPixyMeta(mimeType: String) = when (mimeType) {
|
fun canReadWithPixyMeta(mimeType: String) = when (mimeType) {
|
||||||
|
@ -143,7 +146,7 @@ object MimeTypes {
|
||||||
return if (pageId != null && MultiPageImage.isSupported(mimeType)) {
|
return if (pageId != null && MultiPageImage.isSupported(mimeType)) {
|
||||||
true
|
true
|
||||||
} else when (mimeType) {
|
} else when (mimeType) {
|
||||||
DNG, DNG_ADOBE, HEIC, HEIF, PNG, WEBP -> true
|
AVIF, DNG, DNG_ADOBE, HEIC, HEIF, PNG, WEBP -> true
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,14 @@ extension ExtraAvesEntryCatalog on AvesEntry {
|
||||||
if ((isVideo && (!isSized || durationMillis == 0)) || mimeType == MimeTypes.avif) {
|
if ((isVideo && (!isSized || durationMillis == 0)) || mimeType == MimeTypes.avif) {
|
||||||
// exotic video that is not sized during loading
|
// exotic video that is not sized during loading
|
||||||
final fields = await VideoMetadataFormatter.getLoadingMetadata(this);
|
final fields = await VideoMetadataFormatter.getLoadingMetadata(this);
|
||||||
|
// check size as the video interpreter may fail on some AVIF stills
|
||||||
|
final width = fields['width'];
|
||||||
|
final height = fields['height'];
|
||||||
|
final isValid = (width == null || width > 0) && (height == null || height > 0);
|
||||||
|
if (isValid) {
|
||||||
await applyNewFields(fields, persist: persist);
|
await applyNewFields(fields, persist: persist);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// cataloguing on platform
|
// cataloguing on platform
|
||||||
catalogMetadata = await metadataFetchService.getCatalogMetadata(this, background: background);
|
catalogMetadata = await metadataFetchService.getCatalogMetadata(this, background: background);
|
||||||
|
|
Loading…
Reference in a new issue