framesjs/frames.js

Image has to be less than 256kb

mint-pz opened this issue · 2 comments

https://warpcast.com/~/developers/frames shows me the error Image has to be less than 256kb while the frame spec said The size of the image must be < 10 MB. (https://docs.farcaster.xyz/reference/frames/spec#images)

My frame has a div tag with a background image (~140kb) but after the compile process, the size is up to ~700kb

<FrameImage aspectRatio="1.91:1">
   <div
            tw="flex"
            style={{
              paddingTop: "170px",
              background: "blue",
              width:'100%',
              height: "100vh",
              backgroundSize: "100% 100%",
              backgroundImage: `url('${
                baseUrl + "/images/backgrounds/bg_4.png"
              }')`,
            }}
          >
         
          </div>
</FrameImage>

Any work around ways to fix it? Thanks in advance!

Update: I put a image option options={{ width: 400, height: 330 }} to the FrameImage and the size is down

@mint-pz you can return the image directly using the src prop e.g. <FrameImage src=… > if that suits your use case. See the explanation here #103 (comment)