public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* docx -> markdown: image width and height doesn't respect --dpi?
@ 2017-08-28  3:21 Thomas Blom
       [not found] ` <692f87e9-d992-4d10-a29a-77165f5d5771-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Blom @ 2017-08-28  3:21 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1549 bytes --]

Hi,

I convert docx to markdown using pandoc 1.19.2.1 on OSX 10.12 with

pandoc -t markdown_strict --dpi=128 --extract-media=images mydoc.docx -o 
mydoc.md

I find that the image sizes in the markdown appear to be based on a 96dpi 
image resolution no matter what --dpi I specify, and also no matter the 
meta-data in the files embedded in the (word for mac 2011) document (PNG, 
144dpi).

For example, one image in Word has been sized by the author to be 
~4.65inches wide.  The resulting markdown for this image specifies a width 
of 443 pixels.  So I see that markdown is using a dpi of 443/4.65 =~ 96 
regardless of efforts on my part to change this.

I would like to adjust this because the images appear smaller at this pixel 
size than the same images in Word.  I can of course write a post-processing 
script to adjust sizes on the markdown document, but would prefer to avoid. 
 It seems like the --dpi option makes sense to address my situation?

Thanks,
Thomas Blom

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/692f87e9-d992-4d10-a29a-77165f5d5771%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2102 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: docx -> markdown: image width and height doesn't respect --dpi?
       [not found] ` <692f87e9-d992-4d10-a29a-77165f5d5771-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-08-28 14:57   ` John MacFarlane
       [not found]     ` <20170828145732.GI57370-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2017-08-28 14:57 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Can you give us a simple docx file to test with?

+++ Thomas Blom [Aug 27 17 20:21 ]:
>   Hi,
>   I convert docx to markdown using pandoc 1.19.2.1 on OSX 10.12 with
>   pandoc -t markdown_strict --dpi=128 --extract-media=images mydoc.docx
>   -o mydoc.md
>   I find that the image sizes in the markdown appear to be based on a
>   96dpi image resolution no matter what --dpi I specify, and also no
>   matter the meta-data in the files embedded in the (word for mac 2011)
>   document (PNG, 144dpi).
>   For example, one image in Word has been sized by the author to be
>   ~4.65inches wide.  The resulting markdown for this image specifies a
>   width of 443 pixels.  So I see that markdown is using a dpi of 443/4.65
>   =~ 96 regardless of efforts on my part to change this.
>   I would like to adjust this because the images appear smaller at this
>   pixel size than the same images in Word.  I can of course write a
>   post-processing script to adjust sizes on the markdown document, but
>   would prefer to avoid.  It seems like the --dpi option makes sense to
>   address my situation?
>   Thanks,
>   Thomas Blom
>
>   --
>   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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [3]https://groups.google.com/d/msgid/pandoc-discuss/692f87e9-d992-4d10-
>   a29a-77165f5d5771%40googlegroups.com.
>   For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. https://groups.google.com/d/msgid/pandoc-discuss/692f87e9-d992-4d10-a29a-77165f5d5771-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   4. https://groups.google.com/d/optout


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: docx -> markdown: image width and height doesn't respect --dpi?
       [not found]     ` <20170828145732.GI57370-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
@ 2017-08-28 15:57       ` Thomas Blom
       [not found]         ` <591842f3-2fcf-4a1b-b031-9b2c4f8dad05-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Blom @ 2017-08-28 15:57 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2257 bytes --]

This is an excerpt from the document in question, which contains an image 
sized to be 4.65 inches wide, and results in a pixel width of 443 no matter 
what --dpi I specify.  The image is included in a block-quote section, 
which we use when we want to ident things because that is one of the few 
styling options that come across in markdown, but omitting this doesn't 
affect the width of the image.

Thanks!


On Monday, August 28, 2017 at 9:57:43 AM UTC-5, John MacFarlane wrote:
>
> Can you give us a simple docx file to test with? 
>
> +++ Thomas Blom [Aug 27 17 20:21 ]: 
> >   Hi, 
> >   I convert docx to markdown using pandoc 1.19.2.1 on OSX 10.12 with 
> >   pandoc -t markdown_strict --dpi=128 --extract-media=images mydoc.docx 
> >   -o mydoc.md 
> >   I find that the image sizes in the markdown appear to be based on a 
> >   96dpi image resolution no matter what --dpi I specify, and also no 
> >   matter the meta-data in the files embedded in the (word for mac 2011) 
> >   document (PNG, 144dpi). 
> >   For example, one image in Word has been sized by the author to be 
> >   ~4.65inches wide.  The resulting markdown for this image specifies a 
> >   width of 443 pixels.  So I see that markdown is using a dpi of 
> 443/4.65 
> >   =~ 96 regardless of efforts on my part to change this. 
> >   I would like to adjust this because the images appear smaller at this 
> >   pixel size than the same images in Word.  I can of course write a 
> >   post-processing script to adjust sizes on the markdown document, but 
> >   would prefer to avoid.  It seems like the --dpi option makes sense to 
> >   address my situation? 
> >   Thanks, 
> >   Thomas Blom 
> > 
>
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/591842f3-2fcf-4a1b-b031-9b2c4f8dad05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3359 bytes --]

[-- Attachment #2: image4.65inches.docx --]
[-- Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document, Size: 334204 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: docx -> markdown: image width and height doesn't respect --dpi?
       [not found]         ` <591842f3-2fcf-4a1b-b031-9b2c4f8dad05-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-08-29  0:13           ` John MACFARLANE
       [not found]             ` <20170829001310.GA75750-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MACFARLANE @ 2017-08-29  0:13 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

With the dev version of pandoc, when I convert this to
Markdown I get:

> ![MacSSD:Users:kajohnson:Dropbox:Kinetics Book:Chapter 2:Table
> 2-1.png](foo/media/image1.png){width="4.616858048993876in"
> height="2.5in"}

So the Markdown writer doesn't convert the size to pixels;
if it's doing that for you, the behavior has been changed.

+++ Thomas Blom [Aug 28 17 08:57 ]:
>   This is an excerpt from the document in question, which contains an
>   image sized to be 4.65 inches wide, and results in a pixel width of 443
>   no matter what --dpi I specify.  The image is included in a block-quote
>   section, which we use when we want to ident things because that is one
>   of the few styling options that come across in markdown, but omitting
>   this doesn't affect the width of the image.
>   Thanks!
>   On Monday, August 28, 2017 at 9:57:43 AM UTC-5, John MacFarlane wrote:
>
>     Can you give us a simple docx file to test with?
>     +++ Thomas Blom [Aug 27 17 20:21 ]:
>     >   Hi,
>     >   I convert docx to markdown using pandoc 1.19.2.1 on OSX 10.12
>     with
>     >   pandoc -t markdown_strict --dpi=128 --extract-media=images
>     mydoc.docx
>     >   -o [1]mydoc.md
>     >   I find that the image sizes in the markdown appear to be based
>     on a
>     >   96dpi image resolution no matter what --dpi I specify, and also
>     no
>     >   matter the meta-data in the files embedded in the (word for mac
>     2011)
>     >   document (PNG, 144dpi).
>     >   For example, one image in Word has been sized by the author to
>     be
>     >   ~4.65inches wide.  The resulting markdown for this image
>     specifies a
>     >   width of 443 pixels.  So I see that markdown is using a dpi of
>     443/4.65
>     >   =~ 96 regardless of efforts on my part to change this.
>     >   I would like to adjust this because the images appear smaller at
>     this
>     >   pixel size than the same images in Word.  I can of course write
>     a
>     >   post-processing script to adjust sizes on the markdown document,
>     but
>     >   would prefer to avoid.  It seems like the --dpi option makes
>     sense to
>     >   address my situation?
>     >   Thanks,
>     >   Thomas Blom
>     >
>
>   --
>   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 [2]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [3]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [4]https://groups.google.com/d/msgid/pandoc-discuss/591842f3-2fcf-4a1b-
>   b031-9b2c4f8dad05%40googlegroups.com.
>   For more options, visit [5]https://groups.google.com/d/optout.
>
>References
>
>   1. http://mydoc.md/
>   2. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   4. https://groups.google.com/d/msgid/pandoc-discuss/591842f3-2fcf-4a1b-b031-9b2c4f8dad05-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   5. https://groups.google.com/d/optout



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: docx -> markdown: image width and height doesn't respect --dpi?
       [not found]             ` <20170829001310.GA75750-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
@ 2017-08-29  1:40               ` Thomas Blom
       [not found]                 ` <11b99952-c27d-4a1a-b689-d0e915d886dc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Blom @ 2017-08-29  1:40 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1265 bytes --]

In my example command illustrating the issue, I am using "-t 
markdown_strict".  

I assume you are using "-t markdown" ?

I am not using the dev version of pandoc, but am using the latest release 
as installed by Homebrew on OSX (1.19.2.1).

Thanks!

On Monday, August 28, 2017 at 7:13:17 PM UTC-5, John MacFarlane wrote:
>
> With the dev version of pandoc, when I convert this to 
> Markdown I get: 
>
> > ![MacSSD:Users:kajohnson:Dropbox:Kinetics Book:Chapter 2:Table 
> > 2-1.png](foo/media/image1.png){width="4.616858048993876in" 
> > height="2.5in"} 
>
> So the Markdown writer doesn't convert the size to pixels; 
> if it's doing that for you, the behavior has been changed. 
>
>
>
>
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/11b99952-c27d-4a1a-b689-d0e915d886dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2011 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: docx -> markdown: image width and height doesn't respect --dpi?
       [not found]                 ` <11b99952-c27d-4a1a-b689-d0e915d886dc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-08-29  6:09                   ` John MacFarlane
       [not found]                     ` <20170829060923.GF59266-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2017-08-29  6:09 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

With -t markdown_strict, the dev version gives

> <img src="media/image1.png" alt="MacSSD:Users:kajohnson:Dropbox:Kinetics Book:Chapter 2:Table 2-1.png" style="width:4.61686in" style="height:2.5in" />

So it looks as if this issue has been fixed in the dev
version.  (Sort of...I need to investigate the duplicated
style attributes in the HTML fallback.)

+++ Thomas Blom [Aug 28 17 18:40 ]:
>   In my example command illustrating the issue, I am using "-t
>   markdown_strict".
>   I assume you are using "-t markdown" ?
>   I am not using the dev version of pandoc, but am using the latest
>   release as installed by Homebrew on OSX (1.19.2.1).
>   Thanks!
>   On Monday, August 28, 2017 at 7:13:17 PM UTC-5, John MacFarlane wrote:
>
>     With the dev version of pandoc, when I convert this to
>     Markdown I get:
>     > ![MacSSD:Users:kajohnson:Dropbox:Kinetics Book:Chapter 2:Table
>     > 2-1.png](foo/media/image1.png){width="4.616858048993876in"
>     > height="2.5in"}
>     So the Markdown writer doesn't convert the size to pixels;
>     if it's doing that for you, the behavior has been changed.
>
>   --
>   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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [3]https://groups.google.com/d/msgid/pandoc-discuss/11b99952-c27d-4a1a-
>   b689-d0e915d886dc%40googlegroups.com.
>   For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. https://groups.google.com/d/msgid/pandoc-discuss/11b99952-c27d-4a1a-b689-d0e915d886dc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   4. https://groups.google.com/d/optout


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: docx -> markdown: image width and height doesn't respect --dpi?
       [not found]                     ` <20170829060923.GF59266-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
@ 2017-08-29 15:01                       ` Thomas Blom
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Blom @ 2017-08-29 15:01 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2966 bytes --]

Ok, thanks for looking into this!

-Thomas

On Tuesday, August 29, 2017 at 1:09:32 AM UTC-5, John MacFarlane wrote:
>
> With -t markdown_strict, the dev version gives 
>
> > <img src="media/image1.png" alt="MacSSD:Users:kajohnson:Dropbox:Kinetics 
> Book:Chapter 2:Table 2-1.png" style="width:4.61686in" style="height:2.5in" 
> /> 
>
> So it looks as if this issue has been fixed in the dev 
> version.  (Sort of...I need to investigate the duplicated 
> style attributes in the HTML fallback.) 
>
> +++ Thomas Blom [Aug 28 17 18:40 ]: 
> >   In my example command illustrating the issue, I am using "-t 
> >   markdown_strict". 
> >   I assume you are using "-t markdown" ? 
> >   I am not using the dev version of pandoc, but am using the latest 
> >   release as installed by Homebrew on OSX (1.19.2.1). 
> >   Thanks! 
> >   On Monday, August 28, 2017 at 7:13:17 PM UTC-5, John MacFarlane wrote: 
> > 
> >     With the dev version of pandoc, when I convert this to 
> >     Markdown I get: 
> >     > ![MacSSD:Users:kajohnson:Dropbox:Kinetics Book:Chapter 2:Table 
> >     > 2-1.png](foo/media/image1.png){width="4.616858048993876in" 
> >     > height="2.5in"} 
> >     So the Markdown writer doesn't convert the size to pixels; 
> >     if it's doing that for you, the behavior has been changed. 
> > 
> >   -- 
> >   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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> >   To post to this group, send email to 
> >   [2]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> >   To view this discussion on the web visit 
> >   [3]
> https://groups.google.com/d/msgid/pandoc-discuss/11b99952-c27d-4a1a- 
> >   b689-d0e915d886dc%40googlegroups.com. 
> >   For more options, visit [4]https://groups.google.com/d/optout. 
> > 
> >References 
> > 
> >   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:> 
> >   2. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:> 
> >   3. 
> https://groups.google.com/d/msgid/pandoc-discuss/11b99952-c27d-4a1a-b689-d0e915d886dc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer 
> >   4. https://groups.google.com/d/optout 
>
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/16de6b70-107f-41ab-9b2c-73c330a0fca2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 6504 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-29 15:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28  3:21 docx -> markdown: image width and height doesn't respect --dpi? Thomas Blom
     [not found] ` <692f87e9-d992-4d10-a29a-77165f5d5771-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-08-28 14:57   ` John MacFarlane
     [not found]     ` <20170828145732.GI57370-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
2017-08-28 15:57       ` Thomas Blom
     [not found]         ` <591842f3-2fcf-4a1b-b031-9b2c4f8dad05-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-08-29  0:13           ` John MACFARLANE
     [not found]             ` <20170829001310.GA75750-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
2017-08-29  1:40               ` Thomas Blom
     [not found]                 ` <11b99952-c27d-4a1a-b689-d0e915d886dc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-08-29  6:09                   ` John MacFarlane
     [not found]                     ` <20170829060923.GF59266-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
2017-08-29 15:01                       ` Thomas Blom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).