kopia lustrzana https://gitlab.com/mysocialportal/relatica
Fix low-res PNG problem by always loading high res of PNG files only
rodzic
1c8223fcdf
commit
91d6f944b0
|
@ -43,7 +43,7 @@ class _MediaAttachmentViewerControlState
|
||||||
|
|
||||||
if (item.explicitType == AttachmentMediaType.video) {
|
if (item.explicitType == AttachmentMediaType.video) {
|
||||||
return AVControl(
|
return AVControl(
|
||||||
videoUrl: item.uri.toString(),
|
videoUrl: item.mainUri.toString(),
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
description: item.description,
|
description: item.description,
|
||||||
|
@ -51,13 +51,13 @@ class _MediaAttachmentViewerControlState
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.explicitType != AttachmentMediaType.image) {
|
if (item.explicitType != AttachmentMediaType.image) {
|
||||||
return Text('${item.explicitType}: ${item.uri}');
|
return Text('${item.explicitType}: ${item.mainUri}');
|
||||||
}
|
}
|
||||||
|
|
||||||
return ImageControl(
|
return ImageControl(
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
imageUrl: item.thumbnailUri.toString(),
|
imageUrl: item.usableThumbnailUri.toString(),
|
||||||
altText: item.description,
|
altText: item.description,
|
||||||
onTap: openMediaScreenCallback,
|
onTap: openMediaScreenCallback,
|
||||||
);
|
);
|
||||||
|
|
|
@ -29,6 +29,12 @@ class MediaAttachment {
|
||||||
|
|
||||||
final Visibility visibility;
|
final Visibility visibility;
|
||||||
|
|
||||||
|
late final String _extension;
|
||||||
|
|
||||||
|
Uri get mainUri => _extension == '.png' ? fullFileUri : uri;
|
||||||
|
|
||||||
|
Uri get usableThumbnailUri => _extension == '.png' ? fullFileUri : uri;
|
||||||
|
|
||||||
MediaAttachment({
|
MediaAttachment({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.uri,
|
required this.uri,
|
||||||
|
@ -40,7 +46,9 @@ class MediaAttachment {
|
||||||
required this.explicitType,
|
required this.explicitType,
|
||||||
required this.description,
|
required this.description,
|
||||||
required this.visibility,
|
required this.visibility,
|
||||||
});
|
}) {
|
||||||
|
_extension = p.extension(fullFileUri.path);
|
||||||
|
}
|
||||||
|
|
||||||
MediaAttachment.randomBuilt()
|
MediaAttachment.randomBuilt()
|
||||||
: id = randomId(),
|
: id = randomId(),
|
||||||
|
|
|
@ -107,7 +107,7 @@ class _MediaViewerScreenState extends State<MediaViewerScreen> {
|
||||||
maxScale: 10.0,
|
maxScale: 10.0,
|
||||||
scaleFactor: 400,
|
scaleFactor: 400,
|
||||||
child: LoginAwareCachedNetworkImage(
|
child: LoginAwareCachedNetworkImage(
|
||||||
imageUrl: currentAttachment.uri.toString()),
|
imageUrl: currentAttachment.mainUri.toString()),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case AttachmentMediaType.unknown:
|
case AttachmentMediaType.unknown:
|
||||||
|
|
Ładowanie…
Reference in New Issue