Hi. pdftoppm -tiff -gray generates horizontally 3x stretched image. pdftoppm -tiff -mono generates a kind of messed up image. TiffWriter::writePointers and TiffWriter::writeRow seem to accept native rowData (1bpp and 8bpp) rather than 24bpp RGB pixel format. I have fixed it by adding supportNativeMonoRowData to ImgWriter. My commit/patch is here. This can be used to fix the problem! However the branch pdftoppm-pdftotif also contains my extra stuff like -singletiff option. https://github.com/HiraokaHyperTools/poppler_mirror/commit/6716c91ce2b84ad2b44745e4b5efafd9443fb675 kenjiuno
The format parameter to the image writers defines the pixel format so there is no need to add the supportNativeMonoRowData() function. I would suggest adding the data: SplashColorMode imageWriterFormat; to SplashBitmap.h. In writeImgFile() (line 353), set imageWriterFormat to the format to supply to writeRow(). ie splashModeMono8 for TiffWriter(TiffWriter::GRAY), splashModeMono1 for TiffWriter(TiffWriter::MONO), and splashModeRGB8 for everything else. Then use imageWriterFormat in writeImgFile() (line 620) to determine the data format to use for mode = splashModeMono8 or splashModeMono1.
Ok, it should be better way. I have rewritten according to your advice! https://github.com/HiraokaHyperTools/poppler_mirror/commit/ec4fcfc4a30adce1795aaf6ccc2dea8936ab4a3c
Adrian will you review the patch or should I?
patch looks good
Pushed with slight changes.
Thank you, it works with no problem!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.