Image format is now selected by file extension or magick().
This commit is contained in:
parent
9c60212ca8
commit
42e7fd9a18
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.2)
|
||||
project(identiconpp
|
||||
VERSION 0.3.0
|
||||
VERSION 0.3.1
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@ int main(int argc, char *argv[])
|
|||
});
|
||||
img = identicon.generate(digest, 500);
|
||||
img.write("identicon_example_ltr_asymmetric.png");
|
||||
img.magick("GIF");
|
||||
img.write("identicon_example_ltr_asymmetric.gif");
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -62,6 +64,7 @@ int main(int argc, char *argv[])
|
|||
});
|
||||
img = identicon.generate(digest, 500);
|
||||
img.write("identicon_example_sigil.png");
|
||||
img.write("identicon_example_sigil.jpg");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -74,7 +74,6 @@ Magick::Image Identiconpp::generate(const string &digest, const uint16_t width)
|
|||
img.scale(Magick::Geometry(imgwidth, imgheight));
|
||||
img.borderColor(Magick::Color('#' + _background));
|
||||
img.border(Magick::Geometry(_padding[0], _padding[1]));
|
||||
img.magick("png");
|
||||
return img;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
* @param digest The pre-computed digest
|
||||
* @param width The width of the image in pixels
|
||||
*
|
||||
* @return The image
|
||||
* @return The image as Magick::Image
|
||||
*/
|
||||
Magick::Image generate(const string &digest, const uint16_t width = 100);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user