Photo_view: [BUG] PhotoView turns in black when zooming bigger than screen size

Created on 19 Oct 2019  Â·  4Comments  Â·  Source: fireslime/photo_view

Describe the bug
I see a black screen when zooming the image

To Reproduce

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
        child: PhotoView(
          imageProvider: AssetImage("assets/image.jpg")
        )
    );
  }
}

What is the current behavior?
I see the image and I can zoom in and out but when I zoom 'too much' screen turns black

Expected behavior
When zooming, I should just see zoomed image...

Screenshots
Better than a sreenshot: a video.
https://youtu.be/Hj-PUbLFdM0

Is this a feature or report a bug?
bug

*If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. The output of flutter doctor can help too. *
Just testing the widget:

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
        child: PhotoView(
          imageProvider: AssetImage("assets/images/carta_estrecho.jpg")
        )
    );
  }
}

What is the expected behavior?
I should be able to zoom in and out the image

Which versions of Flutter/Photo View, and which browser / OS are affected by this issue? Did this work in previous versions of Photo View?
Flutter 1.9.1+hotfix.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 1aedbb1835 (32 hours ago) • 2019-10-17 08:37:27 -0700
Engine • revision b863200c37
Tools • Dart 2.5.0
Windows 10 Pro

I get the same result on my WIndows 10 and on my Macbook Pro, but it only affects Android programs. In iOS emulator I see it OK.

Additional context
image
I was using a big file (6MB) so I thought that could be the culprit. I then used a 9MB file without troubles so that's not the problem. I tried to save this file from different sources (editing it with Adobe Photoshop, Windows Image Viewer, and the result is always the same)
I decided to upload the file so that you an reproduce the issue. Don't worry as it's publicly distributed for testing purposes.

Framework bug

Most helpful comment

Have you tried on the master channel?
Can be related to:
flutter/flutter#36191 and #162

I solved the problem with the code attached in this comment:
https://github.com/flutter/flutter/issues/36191#issuecomment-544370192

Thank you very much.

All 4 comments

Please, use markdown to represent code. I will edit the issue to proper reading.

Have you tried on the master channel?
Can be related to:
flutter/flutter#36191 and #162

Have you tried on the master channel?
Can be related to:
flutter/flutter#36191 and #162

I solved the problem with the code attached in this comment:
https://github.com/flutter/flutter/issues/36191#issuecomment-544370192

Thank you very much.

Nice. I will reopen it to keep in mind to add this in a 'Known issues' on the README. Thank you.

Was this page helpful?
0 / 5 - 0 ratings