JuliaIO / ImageMagick.jl

Thin Wrapper for the library ImageMagick
Other
53 stars 37 forks source link

DataFormat is not respected when saving images with a filename #146

Open azurefx opened 5 years ago

azurefx commented 5 years ago

There are two save_ functions in ImageMagick.jl which accept AbstractString and Stream. The Stream version calls getblob and eventually calls MagickSetImageFormat, so we can use Stream(format"XXX",filename) to specify the file format regardless of file extension. The AbstractString version calls writeimage(wand, filename) directly and lets ImageMagick to infer the format. Thus if we call save(File(format"JPEG","xxx.png"),img), we get a PNG-encoded file (which is not expected).

timholy commented 4 years ago

PR welcome!