Add HEIC image support on Linux via flutter_image_compress_linux#204
Open
hmcqueen wants to merge 1 commit into
Open
Add HEIC image support on Linux via flutter_image_compress_linux#204hmcqueen wants to merge 1 commit into
hmcqueen wants to merge 1 commit into
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_compresshas no Linux platform implementation, and the HEIC conversion code inattachments_service.dartwas gated behind!kIsDesktop, skipping it entirely on desktop platforms.Solution
flutter_image_compress_linuxas 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)!kIsDesktopto!Platform.isWindowsso HEIC conversion runs on Linux and macOS (which already hasflutter_image_compress_macos), while still skipping Windows which has no implementation yetChanges
pubspec.yaml: Addedflutter_image_compress_linux: ^0.1.0to dependencieslib/services/ui/attachments_service.dart: Changed!kIsDesktopto!Platform.isWindowson line 349Testing
loadAndGetProperties()method, so the single change covers all casesAddresses #117 (Linux). Windows HEIC support would require a separate
flutter_image_compress_windowspackage.