Skip to content

When specifying a URL, the file is downloaded with the wrong extension. #123

@EkeMinusYou

Description

@EkeMinusYou

Describe the bug

When specifying a URL, the file is downloaded with the wrong extension.

Steps to reproduce

Run the command below in neovim.

lua require("img-clip").paste_image({download_images = true}, "https://pbs.twimg.com/media/GNeWaqmaMAIFAKA?format=jpg&name=large")

The file will be downloaded as a png

![](assets/2025-04-30-02-59-20.png)

But the actual file type is jpeg.

➜ file 2025-04-30-02-59-20.png
2025-04-30-02-59-20.png: JPEG image data, JFIF standard 1.01, aspect ratio, density 72x72, segment length 16, progressive, precision 8, 2048x1536, components 3

Expected behavior
The file is converted to png or the file extension is jpeg.

Desktop (please complete the following information):

  • OS: Mac
  • Neovim version: v0.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions