Skip to content

Add HEIC image support on Linux via flutter_image_compress_linux#204

Open
hmcqueen wants to merge 1 commit into
OpenBubbles:rustpushfrom
hmcqueen:hmcqueen/feature/heic-linux-support
Open

Add HEIC image support on Linux via flutter_image_compress_linux#204
hmcqueen wants to merge 1 commit into
OpenBubbles:rustpushfrom
hmcqueen:hmcqueen/feature/heic-linux-support

Conversation

@hmcqueen
Copy link
Copy Markdown

@hmcqueen hmcqueen commented May 5, 2026

Adds HEIC image rendering support on Linux desktop.

Problem

HEIC images sent from iPhones display "Failed to display image" on Linux (#117). This is because flutter_image_compress has no Linux platform implementation, and the HEIC conversion code in attachments_service.dart was gated behind !kIsDesktop, skipping it entirely on desktop platforms.

Solution

  • Added flutter_image_compress_linux as a dependency — a federated platform implementation that provides JPEG, PNG, WebP, and HEIC compression on Linux via dart:ffi with native C codecs (libjpeg-turbo, libpng, libwebp, libheif)
  • Changed !kIsDesktop to !Platform.isWindows so HEIC conversion runs on Linux and macOS (which already has flutter_image_compress_macos), while still skipping Windows which has no implementation yet

Changes

  • pubspec.yaml: Added flutter_image_compress_linux: ^0.1.0 to dependencies
  • lib/services/ui/attachments_service.dart: Changed !kIsDesktop to !Platform.isWindows on line 349

Testing

  • Built and tested locally on Pop!_OS 24.04
  • Confirmed HEIC images from iPhone conversations render correctly
  • All existing image paths (attachment picker, message bubbles, fullscreen viewer, media gallery) flow through the same loadAndGetProperties() method, so the single change covers all cases

Addresses #117 (Linux). Windows HEIC support would require a separate flutter_image_compress_windows package.

- Add flutter_image_compress_linux dependency for native HEIC/JPEG/PNG/WebP
  compression on Linux desktop
- Change !kIsDesktop to !Platform.isWindows in attachments_service.dart so
  HEIC conversion runs on Linux (and macOS which already has support)

Fixes OpenBubbles#117
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