imagemagick - Unable to Set DPI for png files ImageMagik -
i using imagemagik 6.7.8 c++ library image creations raw images . problem not able set dpi file type "png" . whereas works ok jpeg,tiff . following sample code
magick::image output; magick::blob outputblob; output.read(geometry->getwidth(), geometry->getheight(), "rgba", magick::charpixel, buffer.get()); // buffer raw image output.resolutionunits(pixelsperinchresolution); const magick::geometry gm(150,150); output.density(gm); // write final output.write(&outputblob, "png");
if replace png jpg or tiff in call output.write see correct dpi
what observed header did contain dpi information when viewed in photoshop or irfanview . unknown reasons not visible in ms paint
Comments
Post a Comment