elixir-mogrify / mogrify

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

Image with Tilde #49

Closed Barno closed 7 years ago

Barno commented 7 years ago

After this operation on my image

Mogrify.open("foojpg") |> Mogrify.image_operator("convert foo.jpg -auto-level -sharpen 0x2.1") |> Mogrify.save(path: "public/bar.jpg")

in my Folder I have two files

bar.jpg and bar.jpg~

Can I avoid bar.jpg~ ?

My version is:

identify -version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-15 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
talklittle commented 7 years ago

You're using the library wrong. Mogrify.image_operator("convert foo.jpg -auto-level -sharpen 0x2.1") doesn't make sense, you're shoehorning a shell command where you should be putting an argument to the mogrify command-line program.

open("foo")
|> custom("auto-level")
|> custom("sharpen", "0x2.1")
|> save(...)
Barno commented 7 years ago

Perfect, in that way i don't have file with tilde. Thanks!