Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Olena
olena
Commits
3d16fd32
Commit
3d16fd32
authored
Nov 25, 2010
by
Guillaume Lazzara
Browse files
mln/io/magick/save.hh: Fix a crash when using GraphicsMagick instead of ImageMagick.
parent
4183f619
Changes
2
Hide whitespace changes
Inline
Side-by-side
milena/ChangeLog
View file @
3d16fd32
2010-11-25 Guillaume Lazzara <z@lrde.epita.fr>
* mln/io/magick/save.hh: Fix a crash when using GraphicsMagick
instead of ImageMagick.
2010-11-19 Guillaume Lazzara <z@lrde.epita.fr>
Add a fastest implementation in io::magick.
milena/mln/io/magick/save.hh
View file @
3d16fd32
...
...
@@ -158,12 +158,21 @@ namespace mln
ncols
=
geom
::
ncols
(
ima
),
nrows
=
geom
::
nrows
(
ima
);
Magick
::
Image
magick_ima
;
// In the construction of a Geometry object, the width (i.e.
// `ncols') comes first, then the height (i.e. `nrows')
// follows.
magick_ima
.
size
(
Magick
::
Geometry
(
ncols
,
nrows
));
//
// FIXME: Default pixel value is set to "white". If the image is
// declared with the default constructor, without specifying a
// default value, no data seems to be allocated and the Pixel view
// declared further fails and segfault...
Magick
::
Image
magick_ima
(
Magick
::
Geometry
(
ncols
,
nrows
),
"white"
);
magick_ima
.
type
(
Magick
::
TrueColorType
);
// Ensure that there is only one reference to underlying image
// If this is not done, then image pixels will not be modified.
magick_ima
.
modifyImage
();
Magick
::
Pixels
view
(
magick_ima
);
// As above, `ncols' is passed before `nrows'.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment