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.

png_chunks_extract #

pub package

Dart port of png-chunks-extract.

Extract the data chunks from a PNG file.

Features #

Useful for reading the metadata of a PNG image, or as the base of a more complete PNG parser.

Getting started #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
...
png_chunks_extract: 1.0.2

Import it:

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

Usage #

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

final chunks = pngExtract.extractChunks(data);

Takes the raw image file data as a Uint8List, and returns an array of chunks. Each chunk has a name and data buffer:

[
  { name: 'IHDR', data: Uint8List([...]) },
  { name: 'IDAT', data: Uint8List([...]) },
  { name: 'IDAT', data: Uint8List([...]) },
  { name: 'IDAT', data: Uint8List([...]) },
  { name: 'IDAT', data: Uint8List([...]) },
  { name: 'IEND', data: Uint8List([]) }
]

Example: #

test/png_chunks_extract_test.dart

3
likes
140
points
99
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