Skip to content

[Impeller] In Image.xxx(), if the image is very high, the image will be squeezed and flattened vertically. #177239

Closed

Description

@z325938399-cpu

Steps to reproduce

Case code:
Image

Running results:
Image

image file:
Image

Expected results

Not being flattened in the vertical direction

Actual results

flattened in the vertical direction

Code sample

Code sample
Scaffold(
    appBar: AppBar(title: const Text('TestView'), centerTitle: true),
    body: SingleChildScrollView(
        child: Image.asset(
            'images/authCenter/im.jpg',
             width: double.infinity,
             fit: BoxFit.fitWidth,
        ),
    ),
);

Screenshots or Video

Image

Logs

No response

Flutter Doctor output

Doctor output
C:\Users\32593>flutter doctor -v
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.32.8, on Microsoft Windows [版本 10.0.19045.6332], locale zh-CN) [535ms]
    • Flutter version 3.32.8 on channel stable at D:\devTools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision edada7c56e (3 months ago), 2025-07-25 14:08:03 +0000
    • Engine revision ef0cd00091
    • Dart version 3.8.1
    • DevTools version 2.45.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Windows Version (10 家庭中文版 64 位, 22H2, 2009) [9.3s]

[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [13.9s]
    • Android SDK at E:\AndroidSDK
    • Platform android-36, build-tools 36.0.0
    • ANDROID_HOME = E:\AndroidSDK
    • Java binary at: E:\Program Files\AndroidStudio\apps\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web [35ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps [33ms]
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2024.2) [28ms]
    • Android Studio at E:\Program Files\AndroidStudio\apps
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)

[√] IntelliJ IDEA Community Edition (version 2025.1) [26ms]
    • IntelliJ at D:\Program Files\IntelliJ IDEA Community Edition 2025.1.2
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] Connected device (3 available) [1,102ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.19045.6332]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 141.0.7390.78
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 138.0.3351.121

[√] Network resources [1,288ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Oct 20, 2025
  2. changed the title [-]在Image.xxx()中,如果图片的高度很高,那么图片垂直方向将会被挤压扁平[/-] [+]In Image.xxx(), if the image is very high, the image will be squeezed and flattened vertically.[/+] on Oct 20, 2025
  3. huycozy commented on Oct 20, 2025

    @huycozy
    Member

    When the issue happens, do you notice this log printed out in the output run?

    [VERBOSE-2:validation.cc(49)] Break on 'ImpellerValidationBreak' to inspect point of failure: Requested texture size (20266, 10134) exceeds maximum supported size of (16384, 16384)
    [VERBOSE-2:validation.cc(49)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create multisample color texture.

    If so, this seems to be similar to #128885.

    Otherwise, can you share the image source so that I can try it on Flutter upstream SDK? Or a full sample code on a GitHub repo could be great as well.

  4. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 20, 2025
  5. z325938399-cpu commented on Oct 21, 2025

    @z325938399-cpu
    Author

    Thank you @huycozy


    Git clone command:

    git clone https://gitee.com/zhenYuFeng/flutter_image_demo.git

    After running this, it might take 5-10 seconds for the image to display.


    Also, I found the method to disable the Impeller renderer from #128885. After trying it, the image displayed correctly.

    I added and commented out the code to disable the Impeller renderer in the AndroidManifest.xml. You can try both with and without disabling the renderer to see the effects.


    My question is: Is disabling the Impeller renderer the only way to fix the image issue? Would disabling it have any performance impact on the app?

  6. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 21, 2025
  7. z325938399-cpu commented on Oct 21, 2025

    @z325938399-cpu
    Author

    The logs below were not output during runtime:

    [VERBOSE-2:validation.cc(49)] Break on 'ImpellerValidationBreak' to inspect point of failure: Requested texture size (20266, 10134) exceeds maximum supported size of (16384, 16384)
    [VERBOSE-2:validation.cc(49)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create multisample color texture.
    
  8. huycozy commented on Oct 21, 2025

    @huycozy
    Member

    Thanks for the update. I'm also able to reproduce the issue on the latest Flutter stable and master channels. This happens on both Android and iOS apps.

    This is also similar to #142794, which has been deduplicated with #128885.

    Device info:

    • Realme 6, Android 11
    • iPhone 17 Pro, iOS 26.0 (emulator)
    Demo screenshots
    Android iOS
    Flutter versions (stable and master)
    [✓] Flutter (Channel stable, 3.35.6, on macOS 26.0 25A354 darwin-arm64, locale en-US) [794ms]
        • Flutter version 3.35.6 on channel stable at /Users/huym4/Documents/WORKING/SDK/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 9f455d2486 (11 days ago), 2025-10-08 14:55:31 -0500
        • Engine revision d2913632a4
        • Dart version 3.9.2
        • DevTools version 2.48.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging
    [!] Flutter (Channel master, 3.38.0-1.0.pre-165, on macOS 26.0 25A354 darwin-arm64, locale en-US) [1,729ms]
        • Flutter version 3.38.0-1.0.pre-165 on channel master at /Users/huym4/Documents/WORKING/SDK/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huym4/Documents/WORKING/SDK/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huym4/Documents/WORKING/SDK/flutter_master. Consider adding /Users/huym4/Documents/WORKING/SDK/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huym4/Documents/WORKING/SDK/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huym4/Documents/WORKING/SDK/flutter_master. Consider adding /Users/huym4/Documents/WORKING/SDK/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 894f27ef71 (5 hours ago), 2025-10-20 16:14:09 -0700
        • Engine revision 7cf7630ccd
        • Dart version 3.11.0 (build 3.11.0-36.0.dev)
        • DevTools version 2.51.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
  9. added
    engineflutter/engine related. See also e: labels.
    a: imagesLoading, displaying, rendering images
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    e: impellerImpeller rendering backend issues and features requests
    and removed
    in triagePresently being triaged by the triage team
    on Oct 21, 2025
  10. z325938399-cpu commented on Oct 25, 2025

    @z325938399-cpu
    Author

    When Impeller is disabled, the image shape is normal, but the clarity becomes blurrier as the height increases.

  11. changed the title [-]In Image.xxx(), if the image is very high, the image will be squeezed and flattened vertically.[/-] [+][Impeller] In Image.xxx(), if the image is very high, the image will be squeezed and flattened vertically.[/+] on Oct 27, 2025
  12. chinmaygarde commented on Oct 27, 2025

    @chinmaygarde
    Contributor

    Both Impeller and Skia need to resize down the image to fit in the available texture bounds. So the blurriness is unavoidable unless the framework performs image tiling.

    This is an Impeller specific issue though in that resizing down is not being done while preserving aspect ratios. Perhaps we are not handling the double.infinity constraints quite correctly.

    Thank you for the excellent reduced test case. Should give us a head start on a fix.

  13. added
    P2Important issues not at the top of the work list
    on Oct 27, 2025
  14. github-actions commented on Oct 27, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: imagesLoading, displaying, rendering imagese: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.35Found to occur in 3.35found in release: 3.38Found to occur in 3.38has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions