Skip to content

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

Open
@azurefx

Description

@azurefx

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).

Activity

timholy

timholy commented on Dec 12, 2019

@timholy
Member

PR welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      DataFormat is not respected when saving images with a filename · Issue #146 · JuliaIO/ImageMagick.jl