【问题标题】:Unable to display tiff images in React无法在 React 中显示 tiff 图像
【发布时间】:2022-01-06 06:35:46
【问题描述】:

我在我的 React 应用程序上显示了一些图像。 显示 jpeg、png 等图像没有问题... 我在显示 tif、tiff 的图像时遇到问题。 我还看到只有 Safari 开箱即用地支持它。是否有显示 tif/tiff 的解决方法?

点击这里->CODESANDBOX

    <img
      style={{
        display: isImageLoaded ? "flex" : "none",
        width: "100%",
        cursor: "zoom-in"
      }}
      src={productImage.imageUrl}
      alt="fef"
      onLoad={handleImageLoading}
    />

    {!isImageLoaded && <CircularProgress />}

【问题讨论】:

    标签: javascript html reactjs ecmascript-6 react-hooks


    【解决方案1】:

    目前还不支持 Firefox、Chrome 等很多浏览器

    这张图表证实了

    https://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support

    如果您想使用这些浏览器,则必须转换您的图像。

    【讨论】:

    猜你喜欢
    • 2016-11-02
    • 2022-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多