Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
azurefx opened this issue Dec 4, 2018 · 1 comment
Open

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

azurefx opened this issue Dec 4, 2018 · 1 comment

Comments

@azurefx
Copy link

azurefx commented Dec 4, 2018

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
Copy link
Member

timholy commented Dec 12, 2019

PR welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants