Skip to content

[Bug report] debugInvertOversizedImages has no effect #757

@khaled-0

Description

@khaled-0

Version

10.0.0.1

Platforms

Android, iOS

Device Model

Irrelevant

flutter info

[✓] Flutter (Channel stable, 3.35.3, on macOS 26.1 25B5062e darwin-arm64, locale en-US) [3.5s]
    • Flutter version 3.35.3 on channel stable at /Users/khaled/.flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a402d9a437 (7 weeks ago), 2025-09-03 14:54:31 -0700
    • Engine revision ddf47dd3ff
    • 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

[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0-rc4) [4.5s]
    • Android SDK at /Users/khaled/Library/Android/sdk
    • Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
    • Platform android-36, build-tools 36.0.0-rc4
    • Java binary at: /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment Homebrew (build 17.0.16+0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [4.9s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17A400
    • CocoaPods version 1.16.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [7ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2025.1) [6ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.8+-14018985-b1038.68)

[✓] VS Code (version 1.105.1) [5ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.120.0

[✓] Connected device (3 available) [7.3s]
    • sdk gphone64 arm64 (mobile)        • emulator-5554             • android-arm64 • Android 14 (API 34) (emulator)
    • Shuvo’s iPhone (wireless) (mobile) • 00008101-001614C11438001E • ios           • iOS 26.0.1 23A355
    • macOS (desktop)                    • macos                     • darwin-arm64  • macOS 26.1 25B5062e darwin-arm64

[✓] Network resources [1,699ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

How to reproduce?

debugInvertOversizedImages is supposed to invert image when a large image is loaded into a small sized widget.
However currently this package does not trigger the debugInvertOversizedImages for any case.

Image

Logs

Performing hot restart...
Syncing files to device sdk gphone64 arm64...
Restarted application in 1,155ms.
D/EGL_emulation( 6933): app_time_stats: avg=2735.05ms min=8.58ms max=10852.57ms count=4

======== Exception caught by painting library ======================================================
The following message was thrown while painting an image:
Image https://placehold.co/600x400.png has a display size of 350×349 but a decode size of 600×400, which uses an additional 611KB (assuming a device pixel ratio of 3.5).

Consider resizing the asset ahead of time, supplying a cacheWidth parameter of 350, a cacheHeight parameter of 349, or using a ResizeImage.

====================================================================================================

Example code (optional)

void main() async {
  debugInvertOversizedImages = true;
  runApp(
    MaterialApp(
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              SizedBox(
                height: 100,
                width: 100,
                child: ExtendedImage.network(
                  "https://placehold.co/600x400.png",
                ),
              ),
              SizedBox(
                height: 100,
                width: 100,
                child: Image.network(
                  "https://placehold.co/600x400.png",
                ),
              ),
            ],
          ),
        ),
      ),
    ),
  );
}

Contact

[email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions