Skip to content

Format error decoding Png: Invalid PNG signature. #3079

Closed

Description

@Lslightly

Description

I made a screenshot by Weixin(version 微信 3.9.8.25, I don't know whether wechat is different from weixin) and store it as an png file(the default format of screenshot in WeChat screenshot) and use image function to show this file. The image is as follows.

result1

The error message is:

error: failed to decode image (Format error decoding Png: Invalid PNG signature.)

I can not upload the image to the web app, so I think there is no need to paste the reproduction url.

The reproduction code is as follows:

#figure(
    image("result1.png", width: 80%),
    caption: "test"
  )

Reproduction URL

No response

Operating system

Linux, Windows11

Typst version

  • I am using the latest version of Typst, typst version typst 0.10.0 (70ca0d2)

Activity

  1. JalinWang commented on Dec 27, 2023

    @JalinWang

    Did you take another screenshot and then try it again?

  2. Lslightly commented on Dec 27, 2023

    @Lslightly
    Author

    Did you take another screenshot and then try it again?

    2

    The image above is generated by WeChat. It doesn't work, either. But images generated by windows11 screenshot are valid.

  3. JalinWang commented on Dec 27, 2023

    @JalinWang
  4. Lslightly commented on Dec 28, 2023

    @Lslightly
    Author

    image

    It seems like a JFIF(JPG) picture 🤔 https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format

    that's it. Thank you very much. The default format of WeChat screenshot to be saved is png but actually the file format is jpg.

    I use file 2.png and the result is as follows:

    $ file 2.png 
    2.png: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 501x61, components 3
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions