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

Allow sentry user to control resolution of captured Flutter screenshots #1200

Closed
cstavitsky opened this issue Dec 20, 2022 · 2 comments
Closed
Assignees
Labels
enhancement flutter flutter Platform: Dart Screenshots Sync: Jira apply to auto-create a Jira shadow ticket

Comments

@cstavitsky
Copy link

cstavitsky commented Dec 20, 2022

Feature request: Allow Sentry users to control the resolution at which Flutter screenshots are captured by Sentry, allow the Sentry user to control the resolution at which screenshots are captured.

For example, Sentry's Unity SDK currently allows users to select among:

  • as is
  • high - 1920p
  • medium - 720p
  • low - 420p

The request is to allow similar choice in resolution for Flutter screenshots.

  • There is concern that larger-resolution screenshots may cause bandwidth problems for events captured on low-end mobile devices and regions with poor cellular connectivity. The thought is that being able to adjust resolution would help with this.

┆Issue is synchronized with this Jira Improvement by Unito

@marandaneto
Copy link
Contributor

marandaneto commented Feb 8, 2023

We can add the max resolution to SentryFlutterOptions and allow users to change it during SDK init.
https://api.flutter.dev/flutter/rendering/RenderRepaintBoundary/toImage.html
Maybe the pixelRatio is enough, if not, we can likely manipulate the returned Image.
IIRC Unity has this already, so let's align on the naming and format @bitsandfoxes if possible.

@bitsandfoxes
Copy link

IIRC Unity has this already, so let's align on the naming and format @bitsandfoxes if possible.

The Unity SDK went with ScreenshotQuality

public enum ScreenshotQuality
{
    Full,
    High,
    Medium,
    Low
}

Which translates into max dimension while keeping the aspect ratio

return quality switch
{
    ScreenshotQuality.High => 1920,     // 1080p
    ScreenshotQuality.Medium => 1280,   // 720p
    ScreenshotQuality.Low => 854,       // 480p
    _ => 854                            // Fallback
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement flutter flutter Platform: Dart Screenshots Sync: Jira apply to auto-create a Jira shadow ticket
Projects
Archived in project
Development

No branches or pull requests

5 participants