Linux platform implementation of flutter_image_compress.
Uses dart:ffi with native C codecs for high-performance image compression supporting JPEG, PNG, WebP, and HEIC formats.
- JPEG, PNG, WebP encode/decode via libjpeg-turbo, libpng, libwebp
- HEIC/HEIF decode and encode via libheif + libde265 + kvazaar
- Image resizing with aspect ratio preservation
- Image rotation (0°, 90°, 180°, 270° fast paths)
- EXIF metadata preservation
- Quality control for lossy formats
- Works with Flatpak, Snap, AppImage, and native installs
This package is automatically used by flutter_image_compress on Linux. No additional setup is needed.
import 'package:flutter_image_compress/flutter_image_compress.dart';
final result = await FlutterImageCompress.compressWithFile(
'/path/to/image.heic',
quality: 80,
format: CompressFormat.jpeg,
);Native codec libraries are bundled automatically. For development:
- CMake 3.16+
- GCC or Clang with C11 support
- pkg-config
To build against system libraries instead of bundled ones:
cmake -DUSE_SYSTEM_LIBS=ON ..MIT — matching the upstream flutter_image_compress license.
Bundled codec libraries are LGPL-2.1 or more permissive, dynamically linked as separate .so files for LGPL compliance.