Merge pull request #1488 from marekvospel/no-unnecessary-thumbnail

fix: dont use thumbnails for emoticons
pull/1492/head
Krille-chan 3 months ago committed by GitHub
commit a4c0bd8b25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

@ -122,6 +122,7 @@ class _Reaction extends StatelessWidget {
width: 20, width: 20,
height: 20, height: 20,
animated: false, animated: false,
isThumbnail: false,
), ),
if (count > 1) ...[ if (count > 1) ...[
const SizedBox(width: 4), const SizedBox(width: 4),

@ -276,6 +276,7 @@ class InputBar extends StatelessWidget {
: null, : null,
width: size, width: size,
height: size, height: size,
isThumbnail: false,
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
Text(suggestion['name']!), Text(suggestion['name']!),

@ -92,6 +92,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
width: 128, width: 128,
height: 128, height: 128,
animated: true, animated: true,
isThumbnail: false,
), ),
), ),
); );

@ -247,6 +247,7 @@ class _EmoteImage extends StatelessWidget {
fit: BoxFit.contain, fit: BoxFit.contain,
width: size, width: size,
height: size, height: size,
isThumbnail: false,
), ),
); );
} }

Loading…
Cancel
Save