Repository: flutter
Issue: ImageProvider can't be resized with ImageConfiguration
Labels: a: images,package,p: palette_generator,team-ecosystem,P3,triaged-ecosystem

I am using the [Palette Generator](https://github.com/flutter/packages/tree/master/packages/palette_generator) and found a really weird bug today. It wasn't working correctly (check image below). If I selected the dark corner, it would get orange. It isn't resizing the image.
<img src="https://user-images.githubusercontent.com/351125/65069362-eb57d300-d960-11e9-8737-ab78baae98e2.png" width="300" />

After a lot of debugging, I discovered, to my surprise, that the bug **isn't in** `PaletteGenerator.fromImageProvider` but here:
```dart
 final ImageStream stream = imageProvider.resolve(
      ImageConfiguration(size: size, devicePixelRatio: 1.0),
    );
```

Size is Size(300.0, 199.7). Output is 640x426. This is wrong!
![image](https://user-images.githubusercontent.com/351125/65068956-1130a800-d960-11e9-8531-9b3d3f752451.png)


I made a quick testing code:

```dart
PaletteGenerator.fromImage(
        await _getImage(load.imageProvider, load.size),
        region: region,
        maximumColorCount: 30,
      );
```

```dart
Future<ui.Image> _getImage(ImageProvider imageProvider, Size size) {
    Completer<ui.Image> completer = Completer<ui.Image>();

    imageProvider.resolve(
      ImageConfiguration(size: size)
    ).addListener(ImageStreamListener((ImageInfo info, bool _) {
      return completer.complete(info.image);
    }));

    return completer.future;
  }
```

To solve the Palette Generator bug, I did:
```dart
    var scaleW = image.width / size.width;
    var scaleH = image.height / size.height;
    var newRegion = Rect.fromLTRB(load.region.left * scaleW, load.region.top * scaleH, load.region.right * scaleW, load.region.bottom * scaleH);
```
Basically, since you can't resize the image, let's resize the selectable region. I do suggest, however, that you fix ImageConfiguration.


```
➜ flutter doctor -v
[✓] Flutter (Channel dev, v1.10.2, on Mac OS X 10.14.6 18G95, locale en-BR)
    • Flutter version 1.10.2 at /usr/local/Cellar/flutter/dev
    • Framework revision f5733f7a62 (6 days ago), 2019-09-11 21:03:42 -0700
    • Engine revision 7ea9884ab0
    • Dart version 2.5.0 (build 2.5.0-dev.4.0 be66176534)


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/bernardoferrari/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Users/bernardoferrari/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.5791312/Android
      Studio 3.5 Preview.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.3, Build version 10G8
    • CocoaPods version 1.7.3

[✓] Android Studio (version 3.5)
    • Android Studio at /Users/bernardoferrari/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.5791312/Android
      Studio 3.5 Preview.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)

[✓] Android Studio
    • Android Studio at /Users/bernardoferrari/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/192.5863777/Android
      Studio 3.6 Preview.app/Contents
    • Flutter plugin version 39.0.4
    • Dart plugin version 192.6527
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.2)
    • IntelliJ at /Users/bernardoferrari/Applications/JetBrains Toolbox/IntelliJ
      IDEA Ultimate.app
    • Flutter plugin version 38.2.4
    • Dart plugin version 192.6459

[✓] VS Code (version 1.38.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.4.1

[✓] Connected device (1 available)
    • Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 10
      (API 29) (emulator)

• No issues found!

```