Code: Select all
#include <cassert>
#include <list>
#include <Magick++.h>
int main()
{
std::list<Magick::Image> imageList;
readImages( &imageList, "jet.pdf" );
assert(imageList.begin()->density() == Magick::Geometry(72,72));
for_each(imageList.begin(), imageList.end(), Magick::densityImage("300x300")); // sets the property value correctly to 300x300 dpi
assert(imageList.begin()->density() == Magick::Geometry(300,300));
writeImages(imageList.begin(), imageList.end(), "jet%02d.png"); // but the image is written as if it was read 72x72 dpi
return 0;
}
What I'm trying to achieve is a multi-page version of the following routine, which works perfectly:
Code: Select all
Magick::Image image;
image.density("100");
image.read("jet.pdf");
image.write("jet.png");