image_whisperer 0.10.0

  • Installing
  • Versions
  • 70


Rotate and resize images before uploading as necessary.

Rotates the image according to the EXIF information so the image will look normal after reencoding or when they are displayed on a canvas.

Also images can be resized by specifying maximum width/height/pixels (as in maximum number of megapixels, but without the mega prefix).


Two types of images are used and supported: BlobImage and CanvasImage. BlobImage contains a dart:html Blob with the image data (image file contents), CanvasImage contains a CanvasElement with the image itself.

ImageProcessingPipeline pipeline = new ImageProcessingPipeline();
// The current version of the pipeline returns a BlobImage no matter what.
// Sets the output format to JPEG and the quality to 75.
pipeline.requireBlob("image/jpeg", quality: 75);
// The result should contain no more than 4096 pixels (which makes it quite small)
pipeline.maxPixels = 4096;
// Let's assume there's a `<input type="file"/>` field in the DOM and happens to
// have a nonempty value
FileUploadInputElement input = querySelector("input[type=file]");
File file = input.files.first;
BlobImage image = new BlobImage(file, name:;
pipeline.process(image).then((BaseImage result) {
  // result is a BlobImage, and will always be with the default settings,
  // but I may change the API so we can receive a CanvasImage.
  Blob blob = (result as BlobImage).blob;

  // start a "download", so the image is saved

  String url;
  try {
    url = Url.createObjectUrl(blob);
    AnchorElement a = new AnchorElement(); = "${}.resized.jpg";
    a.href = url;;
  } finally {
    if (url != null) Url.revokeObjectUrl(url);

Getting Started

Check out the project for an example and details on how to deal with the pipeline and BaseImage objects.


  • bumped exifdart version
  • the library now requires Dart 2


  • bumped exifdart version


  • Added polyfill to fix IE11's lack of support of quality parameters in HTMLCanvasElement.toBlob


  • The pipeline can skip encoding the image to file and return with a CanvasImage (or a BlobImage if no adjustment was needed at all)


  • Added wrappers for Url.createObjectUrl and Url.revokeObjectUrl in BlobImage
  • Made a function private that was previously public by accident


  • Fixed handling of files without EXIF


Maintenance release.


  • Added the option to use the not really recommended native scaler: it applies no filters, the photos will look ugly. But it's fast.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  image_whisperer: ^0.10.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:image_whisperer/image_whisperer.dart';
Version Uploaded Documentation Archive
0.10.0 Aug 21, 2018 Go to the documentation of image_whisperer 0.10.0 Download image_whisperer 0.10.0 archive
0.9.3+1 Jan 31, 2018 Go to the documentation of image_whisperer 0.9.3+1 Download image_whisperer 0.9.3+1 archive
0.9.3 Nov 27, 2017 Go to the documentation of image_whisperer 0.9.3 Download image_whisperer 0.9.3 archive
0.9.2 Nov 27, 2017 Go to the documentation of image_whisperer 0.9.2 Download image_whisperer 0.9.2 archive
0.9.1+2 Nov 24, 2017 Go to the documentation of image_whisperer 0.9.1+2 Download image_whisperer 0.9.1+2 archive
0.9.1+1 Nov 23, 2017 Go to the documentation of image_whisperer 0.9.1+1 Download image_whisperer 0.9.1+1 archive
0.9.1 Nov 23, 2017 Go to the documentation of image_whisperer 0.9.1 Download image_whisperer 0.9.1 archive
0.9.0+2 Nov 23, 2017 Go to the documentation of image_whisperer 0.9.0+2 Download image_whisperer 0.9.0+2 archive
0.9.0+1 Nov 23, 2017 Go to the documentation of image_whisperer 0.9.0+1 Download image_whisperer 0.9.0+1 archive
0.9.0 Nov 23, 2017 Go to the documentation of image_whisperer 0.9.0 Download image_whisperer 0.9.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: web

Primary library: package:image_whisperer/image_whisperer.dart with components: html.

Health suggestions

Format lib/src/classes.dart.

Run dartfmt to format lib/src/classes.dart.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use image_whisperer.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
exifdart >=0.7.0 <0.8.0 0.7.0+1