Skip to content

Remove dead PNG fallback from widget chart loading - #87

Merged
timbortnik merged 1 commit into
mainfrom
chore/remove-dead-png-fallback
Nov 9, 2026
Merged

timbortnik merged 1 commit into
mainfrom
chore/remove-dead-png-fallback

Conversation

@timbortnik

Copy link
Copy Markdown
Owner

loadChartBitmap kept a BitmapFactory.decodeFile branch for PNG chart files from the January design, when the Flutter app screenshotted its chart into a PNG for the widget. Both callers have passed pngPath = null since b795e3f (multi-aspect-ratio widgets), and nothing has written those files since charts moved to native SVG (#7), so the branch was unreachable. R8 couldn't drop it because MeteogramWidgetProvider is kept whole by a keep rule.

Removing it also removes our only BitmapFactory call, which Play Console flags as "BitmapFactory without downsampling". The remaining calls in the release build are AndroidSVG's (embedded data URLs, which our SVGs never contain) and Flutter's image decoders.

No behaviour change.

loadChartBitmap kept a BitmapFactory.decodeFile branch for PNG chart files
from the January design, when the Flutter app screenshotted its chart into a
PNG for the widget. Both callers have passed pngPath = null since b795e3f
(multi-aspect-ratio widgets), and nothing has written those files since
charts moved to native SVG (#7), so the branch was unreachable. R8 couldn't
drop it because MeteogramWidgetProvider is kept whole by a keep rule.

Removing it also removes our only BitmapFactory call, which Play Console
flags as "BitmapFactory without downsampling". The remaining calls in the
release build are AndroidSVG's (embedded <image> data URLs, which our SVGs
never contain) and Flutter's image decoders.

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics -4 complexity · 0 duplication

Metric Results
Complexity -4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@timbortnik
timbortnik merged commit 062fab6 into main Nov 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant