[Firebase Storage + Flutter Web] Failed to detect image file format using the file header
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 38/100
調査の方向性
レポートのエントリポイントは CachedNetworkImage、FirebaseHttpFileService、CustomCacheManager です。まず Flutter Web で相対 Firebase Storage URL を再現し、完全修飾された HTTPS URL と比較してください。相対パスが有効なヘッダー付きの画像バイトを返し、ImageCodecException なしでレンダリングされれば完了です。表示されているバージョンで検証してください。
索引モデルが issue の本文から書いたものです。
説明
🐛 Bug Report
When I try to load an image with "CachedNetworkImage()" I get the following error and the image can't be visualized:
ImageCodecException: Failed to detect image file format using the file header.
File header was [0x3c 0x21 0x44 0x4f 0x43 0x54 0x59 0x50 0x45 0x20].
Image source: http://localhost:49430/Shop/hHtD0QEuS2NkzWvSTUOZ/computer2.png
- The problem only appears in Flutter Web with relative URIs from Firebase Storage (
fileService: FirebaseHttpFileService()is used). - The same code works for iOS/Android.
- In the console of Firebase Storage I see that the image has the correct MIME-type "image/jpeg".
- All images which I tested (.png / .jpeg) have this problem.
- Using
-web-renderer htmldoesn't solve the problem. - If I use CachedNetworkImage() for the same picture from Firebase Storage with a fully qualified https-URL (instead of using FirebaseHttpFileService) then the picture is visualized correctly in Flutter Web.
Expected behavior
CachedNetworkImage should be able to visualize Firebase Storage pictures when using fileService: FirebaseHttpFileService() with relative paths.
Reproduction steps
CachedNetworkImage(
imageUrl: 'Shop/hHtD0QEuS2NkzWvSTUOZ/computer2.png',
placeholder: (context, url) => Center(child: customCircularProgressIndicator()),
errorWidget: (context, url, error) {
print(error);
return const Icon(Icons.close, color: MyColors.error);
},
cacheManager: CustomCacheManager(),
),
"imageUrl" is a relative path inside Firebase Storage.
class CustomCacheManager extends CacheManager {
static const key = CKeys.customCacheManagerKey;
static final CustomCacheManager _instance = CustomCacheManager._internal();
CustomCacheManager._internal()
: super(
Config(
key,
stalePeriod: const Duration(days: 1),
fileService: FirebaseHttpFileService(),
),
);
factory CustomCacheManager() {
return _instance;
}
}
Configuration
Version:
cached_network_image: 3.4.0
flutter_cache_manager_firebase: 2.1.1
Platform:
- 📱 iOS
- 🤖 Android
- 🖥️ Web
- 主要言語
- Dart
- スター
- 2.6k
- フォーク
- 734
- 平均マージ
- 3日 10時間
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Baseflow/flutter_cached_network_image のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Baseflow/flutter_cached_network_image#492 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
Baseflow/flutter_cached_network_image#478 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Baseflow/flutter_cached_network_image#473 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
Baseflow/flutter_cached_network_image#1032 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
Baseflow/flutter_cached_network_image#1031 ·
メンテナーはふだん 1 日以内に返信
Baseflow/flutter_cached_network_image の issue をすべて見る
似ている issue
-
Smart charging: USB charger re-assert is starved during BLE scans, so the tablet never dischargesオープンbug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
decentespresso/decaid#931 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
flame-engine/flame#4067 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mrgnhnt96/zonai#37 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
google/skills_lint.dart#58 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nvim-flutter/flutter-tools.nvim#557 ·
メンテナーはふだん 1 日以内に返信