From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28678 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: tiff sizing problems in md to docx Date: Wed, 23 Jun 2021 10:27:06 -0700 Message-ID: References: <131ae7e2-cb6a-47a0-a2b6-c724cfba584an@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39542"; mail-complaints-to="usenet@ciao.gmane.io" To: "jmuc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBB6G5ZWDAMGQEARSFVXI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 23 19:27:25 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f185.google.com ([209.85.210.185]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lw6ep-000A1s-Lb for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 23 Jun 2021 19:27:23 +0200 Original-Received: by mail-pf1-f185.google.com with SMTP id e17-20020aa798110000b02902f12fffef4esf2173474pfl.7 for ; Wed, 23 Jun 2021 10:27:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624469242; cv=pass; d=google.com; s=arc-20160816; b=gTMxtnigF3peWptAL0yRdoaWc3DBhTVv6ReDlquSwmdKaQrB6D+nV1lHoDi/kurtYq zOjpM+PUumUx+U6/yct31vw9DJ6vn2yK0qAATJudb6e43UXRk4JnNdJM6dcfYhau4bTm tja1jZczJEymB69s42IRw+oXmYiew4hj8v06PNzQQmmQJTK1SJ9q0RqJfoYB8jyld/9W jNwnhykPPfgkAdLHX/4dolVV1h8leN62hPKyldqyhVo1OMRhEtuiGcnhiY2PqDTK1pFg gxi/R7LciLk69SDQ+fQeWre7YSQZrkP6L4W9VfNeb/FbCAO1ZJxqdRITC8TK0/Q5QfB7 3hiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=tbISc67ttDqMH0ojcnmUDh2W5eX6rZ09BaYA3ZQNwLk=; b=XPptE6A2Zyta2+vU7CtHME1QxL1eX7xU+LsT+KURjwWmeb+wrTzxp38FrwRpubm72t hqYEYyhG8E0MxJnzRi3WOVEv99s7mK8KBOuU32bS0hLjK1Odr7OvX1ZmqBRVEha/pydS yKh6A/7767qcJtGtlEPzFNyLNYg1VuFyC9TyYkvBoP5LXSY6YrrOl2LLQElOTANLljw7 QpsOE7kWy59aU+z8r7kYvI7Hq37dc/IZ8zHMgiK0seumIjL9kAtAp8wEN8wVvcFae1eN H8Acd4uzsJKI5Jkpcidqyet0DcMaEA2zzuVldtSqoG7d0T59Qvx+aOLZz9YDwZHtwx6P 3MLQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=ENlvvmTF; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::430 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=tbISc67ttDqMH0ojcnmUDh2W5eX6rZ09BaYA3ZQNwLk=; b=qrypIy1FRET4nORIoRGEVdapGVDXNRQnZOOnDg+e9oR2lYHxx7Uitmwapjp6Kvaz8L WWCBZGnuBdfYo17Y0j1ndoQ4+xs2IIsquhzXcLjwyWWcYzJlC0yopUMq6oAAOi0qAnH/ pJAX36Wu28dUK3+W/HTdEa6MmMQGKhyjI2iT8t8aohaAtqIWKGkCzypWSSGG88oTqrgF /U2ixda/ziaBgcACacCtZgxzBLW9uhtoMpgc6/Mg8CfKTatiB5gFZp1FJqYofLJekSkS xbZ7LOB+6tDp/eaYH+gO/3ml42nEOE2TExtUSeHreGq9e0xN6QNLXpUJr2b8vigxygTi DG8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=tbISc67ttDqMH0ojcnmUDh2W5eX6rZ09BaYA3ZQNwLk=; b=Cl5bsut6DoydEpCVehfmbQFei6rvfPB1wl/l/HostonLWKtZS2DTKXI3+/15bV16sh 92dYHh9z78bi7Z6JrXGruZBe4KruSDEdR8KPXxrWMwZf+WF70mYeLIlvhKmjwubl2ToH FdMY3f4a/2ahj4kqzrtM9ECx+Spa3+msC/s3V0iCJgdj2OdthLW7LEQ1qMGG0cTdsMKb vaTKeHa49h8ydNoGy30cMVXFx5Gr8hesBcav8WZzcsTj7GITNl5G3H3Qs5pkz23L6Gpx 1UDTRpdySjgcQfbgtXA/GbdogoOvafWFznhDDhpamDpHg8GzKmHSszSekMxxjCFOR339 1DtA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM5316BwU3MlKg6uCsweBAQ3xO1kDJc99BtY+qaU5aaMlHI5fF0bM3 K5akq4T51lQ04Obw2cYpTMo= X-Google-Smtp-Source: ABdhPJyWXl/Zf6cUnWt7fY75SvMbTB3d8/+5d0dbXEuege8Ln6MvV5ZPyNFnsXcq5ZSLHb9sMd6osw== X-Received: by 2002:a17:902:dac2:b029:125:d557:cf55 with SMTP id q2-20020a170902dac2b0290125d557cf55mr770750plx.60.1624469241695; Wed, 23 Jun 2021 10:27:21 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:902:7b98:: with SMTP id w24ls1540176pll.0.gmail; Wed, 23 Jun 2021 10:27:19 -0700 (PDT) X-Received: by 2002:a17:90a:a790:: with SMTP id f16mr10846916pjq.176.1624469239869; Wed, 23 Jun 2021 10:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624469239; cv=none; d=google.com; s=arc-20160816; b=CablCzfVJW+lM+nLi5Rw10wrm3PjKSix/uWCPXU6fbYR8BLy/+jqnA4WnXLR4Ju3w3 y1Qq2YM7Mwk2G95irigbRs9fdoq7STqImJ4uoqyj+/zVM2XyauWSW1sTHEGJx69RWiWP CunsJtky783rVlwY/PEEeSTreSSy0FYlcpXGuXbBvSz+PUddtkNGoLcQbgozL7cKE2xN 6o3W0MkB7uTAPWHceC24mNNjXk7JK2QIQIxRnnloU7RYZH4WowH9MRyj1TqxR95gydWH 9JwObPQSKV+f2N4Yacz6sPy62M1jNsznFClLYdfwCrc+6NNSu3RU+5e9zPCF35pdtzXr A+yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=KHS3ck/f+KrO8J9CvgyoBFl0CljqGQ3vUhm84MDokTk=; b=verhLZBPDbgj//YRaa0vX1xeDf7ZFieH0jDJuFJXxBqZ80W06YxxGiLSHvPKXPuHmd KaY+PXo+h1QRFp8/51kJtKTQ8cdP1OE8oKIx/0MZ2lwm28Eo22SpWIeswUSgU0lnG4IG JlUdoB1zwbJijOPtXnzvtnuHuZUu0Dpfc1bn0XAEve70UIaXE80V4wMT+s3+xLHLceFr oU5KG1oTGHnYXc3nahqkZs4JDCBHPrCqG9kdbIgroIOyUO8IaCtIukavOGNEAT89QR6/ z1Tflsx+PaOGrFCWk+8o5Hjnqw6+i95Tlz1q9tXjbe2hyPMlL5G5mdAYmTOhVpA+H3a6 EbMw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=ENlvvmTF; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::430 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com. [2607:f8b0:4864:20::430]) by gmr-mx.google.com with ESMTPS id t15si44295plr.0.2021.06.23.10.27.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jun 2021 10:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::430 as permitted sender) client-ip=2607:f8b0:4864:20::430; Original-Received: by mail-pf1-x430.google.com with SMTP id g192so2863757pfb.6 for ; Wed, 23 Jun 2021 10:27:19 -0700 (PDT) X-Received: by 2002:a05:6a00:b92:b029:303:1a7e:ee40 with SMTP id g18-20020a056a000b92b02903031a7eee40mr769059pfj.76.1624469239343; Wed, 23 Jun 2021 10:27:19 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id w68sm430667pfd.175.2021.06.23.10.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 10:27:18 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id D036DA249; Wed, 23 Jun 2021 13:27:06 -0400 (EDT) In-Reply-To: X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=ENlvvmTF; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::430 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:28678 Archived-At: 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-discuss+unsubscribe-/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.