Mercurial > hg > octave-lyh
changeset 17341:51c011825bcc
__magick_write__: make sure binary images are saved as bilevel for some coders.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Tue, 27 Aug 2013 09:24:15 +0100 |
parents | eb7e9a991ffb |
children | f8ee0ed7f1b8 |
files | libinterp/dldfcn/__magick_read__.cc |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/dldfcn/__magick_read__.cc +++ b/libinterp/dldfcn/__magick_read__.cc @@ -878,7 +878,8 @@ octave_idx_type img_idx = 0; for (octave_idx_type frame = 0; frame < nFrames; frame++) { - // For some reason, we can't set the type to Magick::BilevelType. + // For some reason, we can't set the type to Magick::BilevelType or + // the output image will be black, changing to white has no effect. // However, this will still work fine and a binary image will be // saved because we are setting the bitdepth to 1. Magick::Image m_img = init_enconde_image (nCols, nRows, 1, @@ -901,6 +902,9 @@ } // Save changes to underlying image. m_img.syncPixels (); + // While we could not set it to Bilevel at the start, we can do it + // here otherwise some coders won't save it as binary. + m_img.type (Magick::BilevelType); imvec.push_back (m_img); } }