heic_to_png_jpg 0.0.1
heic_to_png_jpg: ^0.0.1 copied to clipboard
A Flutter package to convert HEIC images to JPG or PNG format on both web and mobile platforms.
HEIC to PNG/JPG Converter A Flutter package to convert HEIC images to PNG or JPG format on both web and mobile platforms. Features
Convert HEIC images to PNG or JPG format Support for Web, iOS, and Android platforms Simple API with dedicated functions for PNG and JPG conversion Adjustable quality for JPG output
Getting Started Installation Add this package to your pubspec.yaml: dependencies: heic_to_png_jpg: ^0.1.0
Run: flutter pub get
Web Setup For web support, add the following script to your web/index.html:
Usage import 'package:heic_to_png_jpg/heic_to_png_jpg.dart'; import 'dart:typed_data';
Future
try { // Convert to PNG Uint8List pngData = await HeicConverter.convertToPNG(heicData: heicData);
// Convert to JPG with custom quality
Uint8List jpgData = await HeicConverter.convertToJPG(
heicData: heicData,
quality: 80,
);
// Use the converted image data
// ...
} catch (e) { print('Error converting image: $e'); } }
Example with FlutterFlow Integrate this package with FlutterFlow using custom functions: // In your FlutterFlow custom functions Future
Future
Notes
Mobile: Uses the heif_converter package for iOS and Android, which requires temporary file operations. Web: Requires the libheif-js script in index.html for HEIC decoding. Fallback: If heif_converter fails or is unsupported, the package falls back to the image package, which may have limited HEIC support.
Issues and Contributions Please file any issues, bugs, or feature requests on our GitHub page. License This project is licensed under the MIT License - see the LICENSE file for details.