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

Satori does not generate the image in this code match the browser-rendered HTML output. #641

Open
YujinLu4 opened this issue Oct 7, 2024 · 0 comments

Comments

@YujinLu4
Copy link

YujinLu4 commented Oct 7, 2024

Bug report

Description / Observed Behavior

I use ImageResponse from next/js to generate a image. Satori does not generate the image in this code match the browser-rendered HTML output.

Expected Behavior

Got a rendered svg.

Reproduction

The PNG is not the same as I expected.

new ImageResponse(
      (
        <div
          style={{
            width: "1200px",
            height: "630px",
            padding: "80px",
            display: "flex",
            background: "linear-gradient(35deg,#68E5DE, #03A8FF)",
          }}
        >
          <p>
            <span
              style={{
                fontSize: "60px",
                lineHeight: "100px",
                backgroundColor: "white",
              }}
            >
              Lorem ipsum dolor sit amet, consectetur adipiscin elit, sed do
              eiusmod tempor incididunt
            </span>
          </p>
        </div>
      ),
      {
        fonts: [
          {
            name: "Klavika",
            data: await klavika,
            style: "normal",
            weight: 600,
          },
        ],
        width: 1200,
        height: 630,
      },
    );

Additional Context

what I want:
Screenshot 2024-10-07 at 2 33 35 PM

what I got:
fromImageResponse

Node.js v20.11.0. next/js v14.2.6

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

2 participants
@YujinLu4 and others