Group4Layers / ex_image_info

ExImageInfo is an Elixir library to parse images (binaries) and get the dimensions (size), detected mime-type and overall validity for a set of image formats. It is the fastest and supports multiple formats.
https://hex.pm/packages/ex_image_info
Other
95 stars 4 forks source link

ExImageInfo.info/1 and .info/2 don't match for :webp #2

Closed Bscruz19 closed 5 years ago

Bscruz19 commented 5 years ago

Hello, The ExImageInfo.info/1 and ExImageInfo.info/2 function returns nil in many cases for the webp format. When we use the ExImageInfo.type or ExImageInfo.seems? functions it works fine.

Here has an example

url = "https://media3.giphy.com/media/jHCmUxSNgRjCOYDHiT/giphy.webp"
{:ok, %HTTPoison.Response{body: image}} = HTTPoison.get(url, []) 
ExImageInfo.type(image) # {"image/webp", "webpVP8"}
ExImageInfo.info(image) # nil

There is something that can be done, or the problem is with the picture itself?

nozalr commented 5 years ago

Hello, @Bscruz19

Thanks for writing. Remember that you are encouraged to provide a PR solving the issue. We'll try to solve as soon as possible.

Regards.

nozalr commented 5 years ago

Hi @Bscruz19. We worked on it. Also, new tests and fixtures are added (animated gif and webp). Please, try the library directly from the github repo and confirm that it works. Afterwards, we will publish the new hex.pm package.

Bscruz19 commented 5 years ago

Hello @nozalr I tested here and is working perfectly!!! Thank you for the correction, and congratulations for the library :D

nozalr commented 5 years ago

;) Package published in hex.pm.