Bugfix: Background color was always transparent with older imagemagick
the build was successful
Details
the build was successful
Details
versions
This commit is contained in:
parent
b0c0e0ef09
commit
e568a64129
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.2)
|
||||
project(identiconpp
|
||||
VERSION 0.3.5
|
||||
VERSION 0.3.6
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
|
|
@ -78,10 +78,12 @@ Magick::Image Identiconpp::generate(const string &digest, const uint16_t width)
|
|||
}
|
||||
}
|
||||
|
||||
img.backgroundColor(Magick::Color('#' + _background));
|
||||
img.scale(Magick::Geometry(imgwidth, imgheight));
|
||||
img.borderColor(Magick::Color('#' + _background));
|
||||
img.border(Magick::Geometry(_padding[0], _padding[1]));
|
||||
// The CompositeOperator prevents the background color to be affected by the
|
||||
// frame color. See https://github.com/ImageMagick/ImageMagick/issues/647
|
||||
img.compose(Magick::CompositeOperator::CopyCompositeOp);
|
||||
img.matteColor(Magick::Color('#' + _background));
|
||||
img.frame(Magick::Geometry(_padding[0], _padding[1]));
|
||||
return img;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
Magick::Image Identiconpp::generate_ltr_asymmetric(const string &digest)
|
||||
{
|
||||
Magick::Image img(Magick::Geometry(_columns, _rows),
|
||||
Magick::Color("#00000000"));
|
||||
Magick::Color('#' + _background));
|
||||
Magick::Color dotcolor = get_color(_columns * _rows + 1, digest);
|
||||
|
||||
for (uint8_t row = 0; row < _rows; ++row)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
Magick::Image Identiconpp::generate_ltr_symmetric(const string &digest)
|
||||
{
|
||||
Magick::Image img(Magick::Geometry(_columns, _rows),
|
||||
Magick::Color("#00000000"));
|
||||
Magick::Color('#' + _background));
|
||||
uint8_t used_columns = _columns / 2 + _columns % 2;
|
||||
Magick::Color dotcolor = get_color(used_columns * _rows + 1, digest);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
Magick::Image Identiconpp::generate_sigil(const string &digest)
|
||||
{
|
||||
Magick::Image img(Magick::Geometry(_columns, _rows),
|
||||
Magick::Color("#00000000"));
|
||||
Magick::Color('#' + _background));
|
||||
Magick::Color dotcolor = get_color(0, digest);
|
||||
|
||||
uint8_t used_columns = _columns / 2 + _columns % 2;
|
||||
|
|
Loading…
Reference in New Issue