fastimage 2.0.0 copy "fastimage: ^2.0.0" to clipboard
fastimage: ^2.0.0 copied to clipboard

Dart library that finds the size and type of an image given its uri by fetching as little as needed.

fastimage #

pub package Dart CI

This is Dart implementation of the excellent Ruby library FastImage. It allows you to find the size and type of a remote image by downloading as little as possible.

Supported image types #

Currently supported image types are JPEG, PNG, GIF, TIFF, WebP, BMP, PSD, ICO and CUR.

Usage #

To use this package, add fastimage as a dependency in your pubspec.yaml file.

Example #

Usage of fastimage is pretty straightforward.

import 'package:fastimage/fastimage.dart';

...

final response = await FastImage.shared().getSize("http://i.imgur.com/7GLI90s.jpg");
// or
final fastImage = FastImage();
final response = await fastImage.getSize("http://i.imgur.com/7GLI90s.jpg");
fastImage.close(); // non-shared instances of FastImage should be closed

print(response)
// Prints: `GetSizeResponse(size: ImageSize(width: 1600, height: 1200), format: ImageFormat.jpeg)`

To Do #

  • Provide documentation
  • Provide example

Thanks & Credits #

7
likes
140
points
30
downloads

Publisher

verified publisherky1vstar.dev

Weekly Downloads

Dart library that finds the size and type of an image given its uri by fetching as little as needed.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, meta

More

Packages that depend on fastimage