Enclose please find the files created with the commands:
ddjvu -verbose -format=tiff -page=19 -segment=112x42+431+965 Zaborowski_MBC.djvu tiff_test.tiff
ddjvu -verbose -format=pdf -page=19 -segment=112x42+431+965 Zaborowski_MBC.djvu pdf_test.pdf
You can reproduce them themselves as the document Zaborowski_MBC.djvu
is available at https://github.com/jsbien/Zaborowski-index4djview.
The PDF file is evidently distorted. The TIFF by most tools is displayed correctly, but it is also incorrect. In the thread
https://tug.org/pipermail/xetex/2021-June/027952.html
the following faults has been described of the file obtained by converting the TIFF output:
Fortunately the ppm output seems OK.
Best regards
Janusz
Would that change do the trick?
diff --git a/tools/ddjvu.cpp b/tools/ddjvu.cpp
index e7b489b7..a7465a28 100644
--- a/tools/ddjvu.cpp
+++ b/tools/ddjvu.cpp
@@ -486,9 +486,9 @@ render(ddjvu_page_t page, int pageno)
TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, (uint32)rrect.w);
TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, (uint32)rrect.h);
TIFFSetField(tiff, TIFFTAG_XRESOLUTION,
- (float)((dpirrect.w+iw/2)/iw));
+ (float)((dpiprect.w+iw/2)/iw));
TIFFSetField(tiff, TIFFTAG_YRESOLUTION,
- (float)((dpirrect.h+ih/2)/ih));
+ (float)((dpi*prect.h+ih/2)/ih));
TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(tiff, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
# ifdef CCITT_SUPPORT
On 6/11/21 12:47 AM, Janusz wrote:
Related
Bugs:
#335Unfortunately after converting TIFFs to PNGs and using them in XeLaTeX I see the same (or very similar) problem. I haven't applied the patch myself but just pulled the code from the repository.
Last edit: Janusz 2021-06-16
Here the fix works on file Zaborowski_MBC.djvu.
You mustn't have obtained the patch for some reason....