image-picka icon indicating copy to clipboard operation
image-picka copied to clipboard

Can't download webp image

Open ImGr0k opened this issue 8 months ago • 1 comments

I have a problem with the Mozzila Firefox add-on that saves images. If I try to save an image via image picka, which is displayed as .jpg, but actually .webp, I get an error or the downloaded image cannot be opened in graphic editors (if downloaded without error message). The image opened on the tab in the address bar says extension .jpg. If you save through the contact menu “save as” browser Firefox changes the extension to webp.

An example of such an image: https://sc04.alicdn.com/kf/H42b0c8057c414ad8a74a5c1e44c94c94b/55inch-Outdoor-Floor-Standing-Digital-Signage-Totem-Lcd-Advertising-Kiosk-Screen-For-Marketing-Advertising-Display.jpg

Do I need to customize the extension somehow, or is it just impossible to do. Tested about 5 other add-ons for downloading images, there is the same problem.

ImGr0k avatar Apr 29 '25 18:04 ImGr0k

https://sc04.alicdn.com/kf/H42b0c8057c414ad8a74a5c1e44c94c94b/55inch-Outdoor-Floor-Standing-Digital-Signage-Totem-Lcd-Advertising-Kiosk-Screen-For-Marketing-Advertising-Display.jpg

I clicked the link and I got a JPG image.

is it just impossible to do.

It should be possible. This extension currently generate the filename from

  1. Content-Disposition header: https://github.com/eight04/image-picka/blob/fccf997510fc7d231baef177476a91bc8535adc7/src/lib/fetch-image.js#L33
  2. The URL: https://github.com/eight04/image-picka/blob/fccf997510fc7d231baef177476a91bc8535adc7/src/lib/expand-env.mjs#L42

It will be better to use MIME to generate the filename. Though we will need to bundle an mime -> filename map to the extension.


For your issue, I would suggest switching to an image viewer which can determine image type from file content instead of the filename, so that it will work with all images including those downloaded by other extensions.

eight04 avatar Apr 29 '25 19:04 eight04