Skip to content

hmcqueen/flutter_image_compress_linux

Repository files navigation

flutter_image_compress_linux

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.

Features

  • 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

Usage

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,
);

Build Requirements

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 ..

License

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.

About

Linux platform implementation of flutter_image_compress. Uses dart:ffi with native C codecs for JPEG, PNG, WebP, and HEIC compression.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors