png_chunks_extract 1.0.2 copy "png_chunks_extract: ^1.0.2" to clipboard
png_chunks_extract: ^1.0.2 copied to clipboard

Extract the data chunks from a PNG file. Useful for reading the metadata of a PNG image, or as the base of a more complete PNG parser.

example/example.dart

import 'dart:io';
import 'package:png_chunks_extract/png_chunks_extract.dart' as pngExtract;

void main() {
  var dir = Directory.current.path;
  if (dir.endsWith('/test')) {
    dir = dir.replaceAll('/test', '');
  }
  File file = File('$dir/test/test.png');
  final data = file.readAsBytesSync();

  final trunk = pngExtract.extractChunks(data);
  final names = trunk.map((e) => e['name']).toList(growable: false);
  final lengths =
  trunk.map((e) => (e['data'] as List).length).toList();

  print('name:$names, $lengths');
}
3
likes
140
points
105
downloads

Publisher

unverified uploader

Weekly Downloads

Extract the data chunks from a PNG file. Useful for reading the metadata of a PNG image, or as the base of a more complete PNG parser.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on png_chunks_extract