Submitted. #7405

On Wednesday, 23 June 2021 at 13:27:23 UTC-4 John MacFarlane wrote:

Why don't you submit an issue to the tracker?
I note that Text.Pandoc.ImageSize doesn't contain a type for
Tiff, and also that the default for imagesize has a 1.5 aspect
ratio...so my guess is that we're just using defaults there.

I think it will be a trivial fix to support tiff properly!

"jmuc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <jmuc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Any help on this one?
>
> Thanks.
>
> On Saturday, 12 June 2021 at 15:34:25 UTC-4 jmuc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
>
>> In working on a document with tiff images in it, I ran into some trouble.
>> Basically the proportions of the tiff get changed in the output docx file.
>> (Caveat: I don't have Word on my computer, but the macOS quicklook, Pages,
>> LibreOffice, Google doc conversation, and some random on-line file
>> converter all show the problem, so I take it that it's real.) I attach one
>> of the problematic docx files.
>>
>> It showed up for me like this:
>>
>> An included tiff image had the wrong proportions in the output docx. The
>> width was scaled down, so the image looked horizontally squished. I attach
>> a screen shot where the first image is a jpeg version and the second a
>> tiff. In that image, the jpeg has the dimensions of 1050x476, for a ratio
>> of 2.20, which matches the original. The tiff is 750x500 for a ratio of
>> 1.50 and the pixel height isn't the same as the jpeg either, so that's
>> getting changed, too.
>>
>> If I look at the document.xml in the unzipped version of the
>> pandoc-generated docx, I see this, which provides a 1.5 ratio of cx to cy:
>>
>> ```
>> <a:xfrm>
>> <a:off x="0" y="0"/>
>> <a:ext cx="3810000" cy="2540000"/>
>> </a:xfrm>
>> ```
>>
>> If I use image magic's format command, the original tiff has the following
>> relevant (I think) properties:
>>
>> - Geometry: 1758x798+0+0
>> - Resolution: 300x300
>> - Print size: 5.86x2.66
>> - Units: PixelsPerInch
>>
>> I don't see anything else that gets me to that 1.5 ratio. Note that both
>> image files in the unzipped docx seem identical to the originals, so
>> nothing is going on there.
>>
>> 2. In doing some testing, I came across a similar problem. I used
>> imagemagick to create two identical images, one jpeg and the other tiff.
>> Then I put them into a docx via pandoc:
>>
>> ```
>> > magick rose: -format jpeg -resize 600% -colorspace gray -units
>> pixelsperinch -density 300 rose.jpeg
>> > magick rose: -format tiff -resize 600% -colorspace gray -units
>> pixelsperinch -density 300 rose.tiff
>> > pandoc -t docx -o rose.docx
>> Hello.
>>
>> ![jpeg](./rose.jpeg)
>>
>> Goodbye
>>
>> ![tiff](rose.tiff)
>>
>> ```
>> In this case the output images are very obviously differently sized, and
>> the second once again has an aspect ratio of 1.5 (the original is 1.52, so
>> the two images look identically proportioned to the eye). It also has the
>> identical pixel size as the tiff in the other example. I attach this file.
>>
>> If I output to odt, I get the following warning and the output file again
>> has a wrongly ratio'd tiff (not shown, but it's square):
>>
>> `[WARNING] Could not determine image size for rose.tiff: could not
>> determine image type`
>>
>> So something appears to be going on with reading tiffs.
>>
>> [image: Screen Shot 2021-06-12 at 14.33.55.png]
>> [image: Screen Shot 2021-06-12 at 14.44.57.png]
>>
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ad6c9227-764d-4a81-9242-efdbbef46916n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7584ca74-f108-4295-96c5-0160dd883687n%40googlegroups.com.