| <<<Back 1 day (to 2020/10/24) | Fwd 1 day (to 2020/10/26)>>> | 20201025 |
Robin_Watts | sh4rm4^bnc: Suppose you have a page with a 1000x1000 image in. | 12:08.40 |
| If you render that at 1x scale (I.e. 72dpi), that might actually only actually render at 100x100 pixels. | 12:09.00 |
| If you then scale that up by (say) a factor of 4, those pixels get interpolated to give you 400x400. | 12:09.34 |
| but 15/16ths of those pixels will be 'invented' by the scaler. | 12:09.49 |
| If on the other hand you rendered at 4x scale to start with, those 400x400 pixels would be produced from scaling the 1000x1000 image down. | 12:10.30 |
sh4rm4^bnc | i understand. how can i get the original resolution/dpi of the image ? | 12:11.24 |
Robin_Watts | sh4rm4^bnc: If you have the fz_image, that's easy. | 12:12.52 |
| But you are working at the page level, right? | 12:13.01 |
sh4rm4^bnc | right | 12:13.09 |
Robin_Watts | So the problem is, that in general you don't have a single image per page. | 12:13.43 |
| I mean, you might, but most files don't. | 12:13.56 |
| You could use the stext device. | 12:14.21 |
sh4rm4^bnc | extract the text and render that myself? | 12:14.48 |
Robin_Watts | Create an stext device, set the flag to include images, run the page to the stext device. close the device. | 12:14.51 |
| That returns you a structure that describes blocks of text on the page. | 12:15.18 |
| because you set the flag to include images, it'll include image blocks too. | 12:15.29 |
| You can walk the structure to read the images and figure out the resolution etc. | 12:15.44 |
| No, you'd still let mupdf do all the rendering. | 12:16.08 |
| the purpose of the stext device is just so you can get the resolutions/positions of the images on the page. | 12:16.30 |
sh4rm4^bnc | hmm. wouldnt there be a way to tell mupdf to choose a bbox where all images are rendered at a resolution that corresponds to the resolution of the most hi-res image in the page? | 12:17.06 |
Robin_Watts | sh4rm4^bnc: Not inbuilt, no. | 12:17.25 |
| But if you want to do that, you do what I just described. | 12:17.39 |
sh4rm4^bnc | ok, thanks | 12:17.50 |
| <<<Back 1 day (to 2020/10/24) | Forward 1 day (to 2020/10/26)>>> | |