wevm/frog

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

開放

#502 建立於 2024年10月15日

 (1 則留言) (0 個反應) (1 位負責人)TypeScript (97 個分叉)user submission
Good First IssueP: LowT: Bug

倉庫指標

星標
 (440 顆星)
PR 合併指標
 (平均合併 1小時 6分鐘) (30 天內合併 71 個 PR)

描述

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

貢獻者指南