Skip to content

Pre defined size and ratio #198

Closed Answered by hm21
sebastianspross asked this question in Q&A
Aug 21, 2024 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

You're correct. After testing, I realized that when the image fits the screen width, I also get 384x384, but when it fits the screen height, I get 512x512. I'll open a new issue and attempt to fix it when I have time.

Meanwhile, I recommend removing the maximum output size from the ImageGenerationConfigs and cropping the image manually. This task is straightforward and requires only a few lines of code. You can use the image package, which is already included in your app, since the image editor depends on it. Below is an example code snippet demonstrating how to crop the image. Optionally, you can also use isolates or web workers combined with a Completer to prevent your UI from freezing.

/…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@sebastianspross
Comment options

@hm21
Comment options

@sebastianspross
Comment options

@hm21
Comment options

Answer selected by sebastianspross
@sebastianspross
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants