Skip to content

Commit dbcb55f

Browse files
Disable image upscaling in canvas image loading (#5674)
Sets allowUpscaling to false when instantiating image codec in loadCanvasImage, preventing automatic upscaling of loaded images.
1 parent b51db65 commit dbcb55f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/flet/lib/src/controls/canvas.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ Future<void> loadCanvasImage(Control shape) async {
565565
throw Exception("Missing image source: 'src' or 'src_bytes'");
566566
}
567567

568-
final codec = await ui.instantiateImageCodec(bytes);
568+
final codec = await ui.instantiateImageCodec(bytes, allowUpscaling: false);
569569
final frame = await codec.getNextFrame();
570570
shape.properties["_image"] = frame.image;
571571
shape.updateProperties({"_hash": getImageHash(shape)},

0 commit comments

Comments
 (0)