fix: dont use thumbnails for emoticons

This commit is contained in:
Marek Vospěl 2024-11-17 18:44:44 +01:00 committed by =
commit 98b4bec41b
No known key found for this signature in database
GPG key ID: 654D7FAA1531BC24
5 changed files with 12 additions and 4 deletions

View file

@ -272,14 +272,18 @@ class ImageExtension extends HtmlExtension {
final width = double.tryParse(context.attributes['width'] ?? '');
final height = double.tryParse(context.attributes['height'] ?? '');
final actualWidth = width ?? height ?? defaultDimension;
final actualHeight = height ?? width ?? defaultDimension;
return WidgetSpan(
child: SizedBox(
width: width ?? height ?? defaultDimension,
height: height ?? width ?? defaultDimension,
width: actualWidth,
height: actualHeight,
child: MxcImage(
uri: mxcUrl,
width: width ?? height ?? defaultDimension,
height: height ?? width ?? defaultDimension,
width: actualWidth,
height: actualHeight,
isThumbnail: (actualWidth * actualHeight) > (256 * 256),
),
),
);