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

Root element width and height don't match imageAspectRatio unless set explicitly #502

Open
1 task done
Sam-Scolari opened this issue Oct 15, 2024 · 1 comment
Open
1 task done
Assignees
Labels
Good First Issue Misc: Good First Issue P: Low Priority: Low T: Bug Type: Bug

Comments

@Sam-Scolari
Copy link

Sam-Scolari commented Oct 15, 2024

Describe the bug

This issue is likely related to #463

In this example, the text will overflow the square frame container. While the frame itself displays as square, the content inside it presumably takes up the width and height of a frame with a rectangular aspect ratio even though width and height are set to 100%.

app.frame("/test", async (c) => {
  return c.res({
    image: (
      <div
        style={{
          color: "white",
          display: "flex",
          fontSize: 60,
          width: "100%",
          height: "100%",
        }}
      >
        This is a really long line of text that overflows the square frame image
        because width and height were not set
      </div>
    ),
    imageAspectRatio: "1:1",
    // Uncommenting this fixes the issue
    // imageOptions: {
    //   width: 1200,
    //   height: 1200,
    // },
  });
});

image

Link to Minimal Reproducible Example

No response

Steps To Reproduce

Frog Version

0.17.4

TypeScript Version

No response

Check existing issues

Anything else?

No response

@dalechyn dalechyn self-assigned this Nov 11, 2024
@dalechyn dalechyn added Good First Issue Misc: Good First Issue P: Low Priority: Low T: Bug Type: Bug labels Nov 11, 2024
@dalechyn
Copy link
Collaborator

Most likely it's satori's issue but might be worthwile to play with and to try to fix it. Will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Misc: Good First Issue P: Low Priority: Low T: Bug Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants