heckofaheic 0.0.3 copy "heckofaheic: ^0.0.3" to clipboard
heckofaheic: ^0.0.3 copied to clipboard

Platformweb

HEIC to PNG converter for Web our beloved

heckofaheic #

pub package

Converts HEIC into PNG/JPEG/GIF using heic2any.

Useful in case your users are uploading HEIC images to your Flutter web app that need to be displayed correctly, as HEIC is not supported by most browsers.

Web only

Getting started #

  1. Please download a copy of heic2any.min.js on alexcorvi.github.io/heic2any
  2. Save it in your Flutter project's web folder, next to index.html
  3. Link the script in your index.html, like so:
    <script src="heic2any.min.js" type="application/javascript"></script>
    
  4. Add a new script tag to your index.html, with the following content:
    <script>
    function executeHeic2any(blob, multiple, toType, quality, gifInterval) {
    	return heic2any({
    		blob,
    		multiple: multiple,
    		toType: toType,
    		quality: quality,
    		gifInterval: gifInterval
    	});
    }
    </script>
    

Usage #

import "package:heckofaheic/heckofaheic.dart";

Future<void> myFunction() async {
  Uint8List imageBytes = await getYourImageBytesSomehow();

  if (HeckOfAHeic.isHEIC(imageBytes)) {
    imageBytes = await HeckOfAHeic.convert(imageBytes);
  }
}

For the full API documentation, please refer to the API reference.

Additional information #

have fun.

2
likes
110
pub points
55%
popularity

Publisher

unverified uploader

HEIC to PNG converter for Web our beloved

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, html, http, js, js_interop

More

Packages that depend on heckofaheic