Skip to content

[web] Image.network() drawing black if cacheWidth/cacheHeight set #160199

Closed
flutter-team-archive/engine
#57200

Description

@milke

Steps to reproduce

Stable version 3.27.0, Image.network() and FadeInImage.memoryNetwork() both draw black if cacheWidth/cacheHeight or imageCacheWidth/imageCacheHeight is set.

In Browser console: WebGL: INVALID_VALUE: texImage2D: The source data has been detached

On another note, I tried removing the cacheWidth/Height and Image eviction didn't work unless I refresh. Calling setState to refresh image didn't work either.

Expected results

I would expect an image to draw normally.

Actual results

The image draws black instead. Calling setState to refresh the image has no effect.

Code sample

N/A

Screenshots or Video

N/A

Logs

Browser console: WebGL: INVALID_VALUE: texImage2D: The source data has been detached

Flutter Doctor output

[✓] Flutter (Channel stable, 3.27.0, on Debian GNU/Linux 12 (bookworm)
    6.1.0-28-amd64, locale en_US.UTF-8)
    • Flutter version 3.27.0 on channel stable at
      /home/steve/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8495dee1fd (27 hours ago), 2024-12-10 14:23:39 -0800
    • Engine revision 83bacfc525
    • Dart version 3.6.0
    • DevTools version 2.40.2
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/steve/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/steve/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.
[✓] Chrome - develop for the web
    • Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
    • Debian clang version 14.0.6
    • cmake version 3.25.1
    • ninja version 1.11.1
    • pkg-config version 1.8.1
[✓] Android Studio (version 2023.1)
    • Android Studio at /home/steve/android-studio
    • Flutter plugin version 77.1.2
    • Dart plugin can be installed from:
      :hammer: https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.95.3)
    • VS Code at /usr/share/code
    • Flutter extension version 3.102.0
[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Debian GNU/Linux 12 (bookworm)
      6.1.0-28-amd64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 131.0.6778.139
[✓] Network resources
    • All expected network resources are available.
• No issues found!

Activity

  1. added
    in triage
    on Dec 13, 2024
  2. danagbemava-nc commented on Dec 13, 2024

    @danagbemava-nc
    Member

    Reproducible on the latest versions of stable and master. It works as expected on the previous stable.

    canvas kit wasm
    Screenshot 2024-12-13 at 8 58 59 AM Screenshot 2024-12-13 at 8 55 15 AM
    import 'package:flutter/material.dart';
    
    void main() => runApp(const MyApp());
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        var title = 'Web Images';
    
        return MaterialApp(
          title: title,
          home: Scaffold(
            appBar: AppBar(
              title: Text(title),
            ),
            body: Image.network(
              'https://picsum.photos/250?image=9',
              cacheHeight: 100,
            ),
          ),
        );
      }
    }
    
    flutter doctor -v
    [!] Flutter (Channel [user-branch], 3.24.5, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        ! Flutter version 3.24.5 on channel [user-branch] at /Users/deanli/dev/switcher
        • Framework revision dec2ee5c1f (4 weeks ago), 2024-11-13 11:13:06 -0800
        • Engine revision a18df97ca5
        • Dart version 3.5.4
        • DevTools version 2.37.3
    
    [✓] Flutter (Channel stable, 3.27.0, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        • Flutter version 3.27.0 on channel stable at /Users/deanli/dev/stable
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 8495dee1fd (2 days ago), 2024-12-10 14:23:39 -0800
        • Engine revision 83bacfc525
        • Dart version 3.6.0
        • DevTools version 2.40.2
    
    [!] Flutter (Channel master, 3.28.0-1.0.pre.99, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        • Flutter version 3.28.0-1.0.pre.99 on channel master at /Users/deanli/dev/master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 6a5445833b (4 hours ago), 2024-12-12 22:53:26 -0500
        • Engine revision 5eedfefe38
        • Dart version 3.7.0 (build 3.7.0-243.0.dev)
        • DevTools version 2.41.0
    
  3. added
    c: regression
    platform-web
    a: images
    c: rendering
    has reproducible steps
    team-web
    found in release: 3.27
    found in release: 3.28
    engine
    e: web_canvaskit
    and removed
    in triage
    on Dec 13, 2024
  4. self-assigned this
    on Dec 13, 2024
  5. michaelheider commented on Dec 16, 2024

    @michaelheider

    Duplicate of #158093

  6. added
    r: fixed
    on Dec 17, 2024
  7. github-actions commented on Dec 31, 2024

    @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.

  8. locked as resolved and limited conversation to collaborators on Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: imagesc: regressionc: renderinge: web_canvaskitenginefound in release: 3.27found in release: 3.28has reproducible stepsplatform-webr: fixedteam-web

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions