Next.js Discord

Discord Forum

next/image does not show image when showing large image

Unanswered
Swedish Lapphund posted this in #help-forum
Open in Discord
Swedish LapphundOP
<Box
  sx={{
    width: "100%",
    flexDirection: "column",
    alignItems: "center",
    justifyContent: "center",
    mt: 2,
    objectFit: "contain",
    display:
      showPreview === "on"
        ? "block"
        : showPreview === "auto" && imgSrc !== previewImagePath
        ? "block"
        : "none",
  }}
>
  <Box sx={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
    <Image
      alt="Preview image"
      onError={() => setImgSrc(previewImagePath)}
      src={imgSrc}
      style={{
        width: "auto",
        height: "300px",
      }}
      width={400}
      height={300}
    />
  </Box>
</Box>;


When I preview an image that is 290MB, and has a resolution of: 40000x12900

3 Replies

Swedish LapphundOP
it basically just starts lagging and eventually crashes the client
any other, "normal" sized images works just fine.
I do not get any errors/warnings in the console, sadly.