Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid image dimensions #66

Open
ranahyder87 opened this issue Jul 29, 2021 · 8 comments
Open

Invalid image dimensions #66

ranahyder87 opened this issue Jul 29, 2021 · 8 comments

Comments

@ranahyder87
Copy link

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Exception: Invalid image dimensions.
E/flutter (10185): #0      ScreenshotController.capture.<anonymous closure> (package:screenshot/screenshot.dart:58:9)

I used Transform and Positioned in Stack. Using this a corner of an image goes outside.

@ranahyder87
Copy link
Author

Looks like the image corner is not an issue, this exception comes on and off.

@whlla
Copy link

whlla commented Sep 8, 2021

I'm getting this error every execution with example code. Running from a background task.
E/BackgroundWorker(20720): errorCode: error, errorMessage: Exception: Invalid image dimensions.

ScreenshotController screenshotController = ScreenshotController();
await screenshotController.captureFromWidget(
  Container(
      height: 200,
      width: 200,
      padding: const EdgeInsets.all(30.0),
      decoration: BoxDecoration(
        border: Border.all(color: Colors.blueAccent, width: 5.0),
        color: Colors.redAccent,
      ),
      child: Text("This is an invisible widget")
  ),
  pixelRatio: 1.0,
).then((Uint8List image) async {
  if (image != null) {
    final imagePath = await File('$directory/$filename').create();
    await imagePath.writeAsBytes(image);
    print('BACKGROUND: img saved.');
  }
});

@CoderJava
Copy link

I have the same issue.

@Tukhtamurodov-Sardorbek
Copy link

Tukhtamurodov-Sardorbek commented Dec 7, 2022

I am facing the same issue, too. No updates yet?

@feduke-nukem
Copy link

same

@learning233
Copy link

you can try increase delay time

@Appsketiers
Copy link

any update on this issue

@dirol90
Copy link

dirol90 commented Mar 15, 2024

Same here on latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants