<div dir="ltr"><div><div>Thanks for that, I realise that in general there is no way to win in all cases, but if gradually all systems lose in the same way then in the end it's less confusing for the users:-)<br><br></div>I'll rebuild and try  those test files later,<br><br></div>David<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 January 2017 at 09:24, luigi scarso <span dir="ltr"><<a href="mailto:luigi.scarso@gmail.com" target="_blank">luigi.scarso@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Jan 14, 2017 at 12:03 AM, David Carlisle <<a href="mailto:d.p.carlisle@gmail.com">d.p.carlisle@gmail.com</a>> wrote:<br>
> Luigi,<br>
><br>
>> So in luatex we have a width of 243pixels at 72dpi, hence 243.91125pt.<br>
><br>
>> On the other side pdftex takes the other way, so we have 243pixels at<br>
> 120dpi, hence  146.34676pt.<br>
><br>
> I think that's an unfortunate choice and ask you to at least give a<br>
> customisation<br>
> option to take the other choice.<br>
<br>
</span>> <a href="https://github.com/latex3/graphics-def/blob/master/testfiles/clip-1-2.jpg" rel="noreferrer" target="_blank">https://github.com/latex3/<wbr>graphics-def/blob/master/<wbr>testfiles/clip-1-2.jpg</a><br>
> <a href="https://github.com/latex3/graphics-def/blob/master/testfiles/clip-1-2.png" rel="noreferrer" target="_blank">https://github.com/latex3/<wbr>graphics-def/blob/master/<wbr>testfiles/clip-1-2.png</a><br>
thank you for the png --- this shows that I could  use the  Exif<br>
0x5110 , Exif 0x5111  and Exif 0x5112<br>
to set the resolution of the jpeg.<br>
<span class="">Exif 0x5110                     : 1<br>
Exif 0x5111                     : 4724<br>
Exif 0x5112                     : 4724<br>
</span>means 4724pixel/1m = 119.989 pixel/in which ~120dpi<br>
(of course Exif 0x5110 (ie PixelUnit)  can be different from Exif<br>
ResolutionUnit , so we have the same problem).<br>
<br>
The png is correct simply because there is a single field for the  x<br>
resolution (and one for the y resolution)<br>
so no ambiguity.<br>
But there is no a standard way to convert jpeg exif tags into  png chunks.<br>
<br>
I have just commited a new writejpg.w, with some changes:<br>
if there is an Exif header with a standard xres, yres and a valid unit<br>
(which can be omitted and it's taken as inch)<br>
then it wins over the input resolution.<br>
We support now also the Exif 0x5110, 0x5111, 0x5112 (used by MicroSoft<br>
?) but only if the unit is correct.<br>
A warning is emitted if the input resolution is different from the<br>
Exif resolution , or if xres=1 or yres=1,<br>
or if the Exif resolutions looks bad.<br>
In short: we use the Exif resolution if it's  valid .<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
luigi<br>
</font></span></blockquote></div><br></div>