Skip to main content

raster_resolution_dpi

Function raster_resolution_dpi 

Source
pub fn raster_resolution_dpi(
    path: &str,
    pixels: (f64, f64),
) -> Option<(f64, f64)>
Expand description

A raster’s own resolution in dots per inch, (x, y), as pdfTeX reads it to size an image: a PNG’s pHYs chunk (unit 1 is per metre), rounded to whole dpi, or a JPEG’s density from the segment right after SOI (jpeg_resolution_dpi) — pdflatex measures an 11811 px/m PNG at 300 dpi and a 118 px/cm JPEG at 299. None when the file states none, only an aspect ratio (unit 0), or one pdfTeX ignores for a raster of pixels (width, height; pdftex_raster_resolution): pdfTeX then takes \pdfimageresolution (raster_sizing_dpi). Reads the head only: both come before the pixels.