What is the problem you are wanting to solve?:
In T256848#6272386 it was noted that page scan images from a PDF, had improved quality when rendered at a higher DPI.
(I am therefore thinking the original scans are at a higher DPI such as in 300 or 600 dpi (typical in imaging and print applications) vs 150 or 96dpi (typical for screen displays)
There is not currently a way to specify the DPI to be used from the File: page, and thus external tools ( like Ghostscript) used for rendering the initial output, later used by Thumbor to generate scaled images, do not have any means of getting this information, directly from uploaders at present.
What's the feature you want:-
*The ability to specify a DPI value and have that value taken into account during the generation of thumbnailed or scaled images based on page content in a PDF file.
- Implement a mechanism that allows Thumbor to retreive the dpi value if present in as a URL parameter and use it to render the image via Ghostscript (for example: /War_and_Peace.djvu/page1-1536px-150dpi-War_and_Peace.djvu.jpg should/could render the image with size 1536px and a dpi of 150) (This step is identical to what @Vlad.shapik is implementing)
- Write code to teach mediawiki-core's DjvuHandler (and also the PdfHandler extension) that the dpi value exists and that it can be used while fetching images
- Have ProofreadPage read the dpi value from somewhere and then pass it to MediaWiki core (my instinct would be to use a Index: page parameter for storage, since that is how ProofreadPage already allows users to set the resolution of the image).