elixir-mogrify / mogrify

Image processing in Elixir (ImageMagick command line wrapper)
MIT License
570 stars 65 forks source link

Implement and test lightweight "identify" function #98

Closed peaceful-james closed 3 years ago

peaceful-james commented 3 years ago

I wrote a simple function that uses imagemagick's "identify" function to get information about an image file.

I was motivated to do this when I tried using verbose to get information about a 1.1MB image on a "free tier" gigalixir app (which has severe memory limits) and hit an OOM problem. It seems strange to run out of memory just trying to get the width and height of an image so I ended up copying code out of this project (especially the regex for parsing the image information string, thanks for that!) and just writing my own function for getting image info.

When I tried my own function on the free tier gigalixir app, I stopped getting OOM issues, so i thought it would be good to make a PR for this.

peaceful-james commented 3 years ago

@talklittle Who should I ping to get a review of this PR?

talklittle commented 3 years ago

Looks good to me. Thanks for the contribution!