From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28679 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "jmuc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" Newsgroups: gmane.text.pandoc Subject: Re: tiff sizing problems in md to docx Date: Wed, 23 Jun 2021 10:49:41 -0700 (PDT) Message-ID: <7584ca74-f108-4295-96c5-0160dd883687n@googlegroups.com> References: <131ae7e2-cb6a-47a0-a2b6-c724cfba584an@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1124_1452411770.1624470581757" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31247"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCX7HCFDXYLRBNXIZWDAMGQEQYTLJUI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 23 19:49:45 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f57.google.com ([209.85.210.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lw70T-0007zV-7m for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 23 Jun 2021 19:49:45 +0200 Original-Received: by mail-ot1-f57.google.com with SMTP id e16-20020a0568302010b02903feaaa5cf10sf1754861otp.8 for ; Wed, 23 Jun 2021 10:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=xH/9Lzh20UEi4Lf8K/1Mb+dDXzFmIdAEi6SE02nA6ZA=; b=d/HQMHf+2dwxgrd2Iy8ZRovAUuoBv+wIdzqY8WmyJBVxJ4veX7aLAd0r8az67WAFAX s5J2TgMMVQdM+1WQIg4Y8mcnepTs0+0TMFOsz0SwDcDshUVbVw/Bj/9jJEPseqI1tK69 AKPzELJSKuE5w92dscbDZhFUtB5wpNTW7KtSoLu4ammi5PmKOZ8mKaDEHLfAgz6RZBvr +iJVVn2TE+8GiUImxmJURvMwYHMPRqwCQbGnEEnvGUIg1TmIno1XxHc6f8kvTS3YI1Bk Rb9NInMxkB/OPpD/UsZBMsW5Zc0VQvqw88zNtPM4wjWv7efGbKRxaZ2NpNp4EBYLS7Tk +5eg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=xH/9Lzh20UEi4Lf8K/1Mb+dDXzFmIdAEi6SE02nA6ZA=; b=jxyJDsZOG8V9HQRQx9EYdioVcTh6VqKRsj37kjptSLEwNRDST3fRhEtBRkGHteFHMQ 8olF8Em4vWCWPxBDakiNO2tzZVW9cuQielzL/NjvF8mF7IXzc4oQVzi4QmV+ctna6a1w 4HGfaOetoZsOrO/LZd+t2ms/AkOAJWOHKPqs1szeRbhxYZoorqMWd1vYy/qybP0T9cmF 1t3ZSzye+oZrvUfckfCY68eoOx0/PUPqHQTRva1Hf12vJofmw3baJVSuw90VZrx3L85C PLe4BxzerhlJg0Mcv0MhRZgUkuXnmrEPYK6sH2SgU+vuz0ZbvnGAw42Q3dDRI+hEIpTv EduA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=xH/9Lzh20UEi4Lf8K/1Mb+dDXzFmIdAEi6SE02nA6ZA=; b=ahqTHpDlt1rsOtXq5sKH5vDdi0lK3lZO8MXOT29552dYcLoNyYbhPzJq8qEwBC/EKP v2MPgaQlRrUUzBlxn78G6NBJmFhG9fU8XPe116tEbd6bSPL12SHLJnDLj2xgeQ/4rItm tHgW2WfYkLwJh5beL8zpv54AUysjcyY0gxxu+Xg9pDVHIJZGV/8AVO2pvK37+AyF5b7r SITKKleI518zV1wGFaI7PO2V0Rs5gRGARn41NYyUTZMuCGiJS8joYFz/t6yq1h/qGPJ2 suNSJ7c/JP8xZXGu6CLlZnnWkldMzuH6qlrfyAMaXEmvaso90In56+h3VhgqrbpSLOCK SoGg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533xmu2QvCpvDMOoQmCveIxJ23C8UKo7Vh5FnV6vjuxUQbMex7CI eyEZQbzWGPBeLbvhQDYfqv4= X-Google-Smtp-Source: ABdhPJx9xzUAT7GrNgqMjQ4jY+SreMi97bs8v2lkeMxcEJa3aHOy7l3xSid3Hv7Fuis/7itNQZidsg== X-Received: by 2002:a05:6830:2011:: with SMTP id e17mr958707otp.295.1624470584135; Wed, 23 Jun 2021 10:49:44 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:b304:: with SMTP id c4ls1232812oif.8.gmail; Wed, 23 Jun 2021 10:49:42 -0700 (PDT) X-Received: by 2002:a05:6808:13c5:: with SMTP id d5mr847442oiw.164.1624470582380; Wed, 23 Jun 2021 10:49:42 -0700 (PDT) In-Reply-To: X-Original-Sender: jmuccigr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:28679 Archived-At: ------=_Part_1124_1452411770.1624470581757 Content-Type: multipart/alternative; boundary="----=_Part_1125_915999487.1624470581757" ------=_Part_1125_915999487.1624470581757 Content-Type: text/plain; charset="UTF-8" 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" 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: > >> > >> ``` > >> > >> > >> > >> > >> ``` > >> > >> 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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. ------=_Part_1125_915999487.1624470581757 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Submitted. #7405<= br>
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&= quot; <jmuc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org&= gt; 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 so= me trouble.=20
>> Basically the proportions of the tiff get changed in the outpu= t docx file.=20
>> (Caveat: I don't have Word on my computer, but the macOS q= uicklook, Pages,=20
>> LibreOffice, Google doc conversation, and some random on-line = file=20
>> converter all show the problem, so I take it that it's rea= l.) I attach one=20
>> 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=20
>> width was scaled down, so the image looked horizontally squish= ed. I attach=20
>> a screen shot where the first image is a jpeg version and the = second a=20
>> tiff. In that image, the jpeg has the dimensions of 1050x476, = for a ratio=20
>> of 2.20, which matches the original. The tiff is 750x500 for a= ratio of=20
>> 1.50 and the pixel height isn't the same as the jpeg eithe= r, so that's=20
>> getting changed, too.
>>
>> If I look at the document.xml in the unzipped version of the= =20
>> pandoc-generated docx, I see this, which provides a 1.5 ratio = of cx to cy:
>>
>> ```
>> <a:xfrm>
>> <a:off x=3D"0" y=3D"0"/>
>> <a:ext cx=3D"3810000" cy=3D"2540000"= ;/>
>> </a:xfrm>
>> ```
>>
>> If I use image magic's format command, the original tiff h= as the following=20
>> 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=20
>> image files in the unzipped docx seem identical to the origina= ls, so=20
>> nothing is going on there.
>>
>> 2. In doing some testing, I came across a similar problem. I u= sed=20
>> imagemagick to create two identical images, one jpeg and the o= ther tiff.=20
>> Then I put them into a docx via pandoc:
>>
>> ```
>> > magick rose: -format jpeg -resize 600% -colorspace gray -= units=20
>> pixelsperinch -density 300 rose.jpeg
>> > magick rose: -format tiff -resize 600% -colorspace gray -= units=20
>> 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=20
>> the second once again has an aspect ratio of 1.5 (the original= is 1.52, so=20
>> the two images look identically proportioned to the eye). It a= lso has the=20
>> identical pixel size as the tiff in the other example. I attac= h this file.
>>
>> If I output to odt, I get the following warning and the output= file again=20
>> has a wrongly ratio'd tiff (not shown, but it's square= ):
>>
>> `[WARNING] Could not determine image size for rose.tiff: could= not=20
>> 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]
>>
>
> --=20
> 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/a= d6c9227-764d-4a81-9242-efdbbef46916n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-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.
------=_Part_1125_915999487.1624470581757-- ------=_Part_1124_1452411770.1624470581757--