Fixed regression in image_resolution due to Pdfunit change

This commit is contained in:
John Whitington 2024-01-10 13:10:39 +00:00
parent 847f498add
commit 3ca5c8bb20
3 changed files with 3 additions and 3 deletions

View File

@ -235,8 +235,8 @@ let rec image_resolution_page pdf page pagenum dpi images =
let newpdf = Pdfpage.change_pages false pdf [page] in
image_resolution newpdf [pagenum] dpi
| (pagenum, name, Image (w, h), objnum) ->
let lx = Pdfunits.points (distance_between o x) Pdfunits.Inch in
let ly = Pdfunits.points (distance_between o y) Pdfunits.Inch in
let lx = Pdfunits.inches (distance_between o x) Pdfunits.PdfPoint in
let ly = Pdfunits.inches (distance_between o y) Pdfunits.PdfPoint in
let wdpi = float w /. lx
and hdpi = float h /. ly in
image_results := (pagenum, xobject, w, h, wdpi, hdpi, objnum)::!image_results

Binary file not shown.

View File

@ -279,7 +279,7 @@ These examples demonstrate just a few of the facilities provided by the Coherent
\noindent Dump attachments to file, given the directory to put them in.
\section*{\hyperref[chap:13]{Chapter 13: Working with Images}}
\section*{\hyperref[chap:13]{Chapter 13: Images}}
\begin{framed}\noindent\texttt{cpdf -image-resolution 600 in.pdf}\end{framed}