[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Inline Images Export Bug

From: Scott Randby
Subject: Re: [O] Inline Images Export Bug
Date: Wed, 26 Aug 2015 19:13:47 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 08/26/2015 06:40 PM, Pip Cet wrote:
Okay, I just checked (sorry, had to regenerate the files and that took
some time), and with the current version of Firefox the code I pasted is

The problem I had with previous Firefox versions is that those decided
on a scale for displaying the SVG that differed from its preferred
resolution, but only if an object tag was used for inclusion; img tags
would use the preferred resolution and everything was fine.

The reason for the pt-to-px arithmetic is that graphviz outputs (or used
to) SVGs with a preferred size specified in pt only, not in px. I'm not
sure, but I think HTML pt and SVG pt don't necessarily agree.

Org mode is generating this tag:

<object type="image/svg+xml" data="org/op-prec.svg" >
Sorry, your browser does not support SVG.</object>

Which looks okay to me. It's browser support that's the issue.

The problems with the second bit of exported code is that it doesn'tscale the 
image to fit the block with 50% width (only a small part of
the image is visible)

Is it possible you're using an old browser? I'm on Iceweasel (Firefox)
38.1.0. (The bug was there a year or two ago, so by my standards it's a
recent fix that we shouldn't rely on yet.)

I'm using Firefox 40.0. I get the same behavior on Google Chrome 44.0 too.

and you when you right click on the image, youcan't view it, save it or 

Again, I can, using the "This Frame" popup menu.

Okay, that works.

But clearly that menu name is misleading and confusing in this case! And
I think that is reason enough to stick with the img tag for now: Firefox
users can't save the image unless they telepathically know that "frame"
means "image". "This Object" might be okay, I guess.

My suggestion is to use img for images; that also appears to be the
consensus on Stack Overflow. Let's find a good syntax for including
interactive objects in Org mode, though.

This sounds reasonable.

On Wed, Aug 26, 2015 at 9:56 PM, Rasmus <address@hidden
<mailto:address@hidden>> wrote:


    Pip Cet <address@hidden <mailto:address@hidden>> writes:

    >     let found = false;
    >     for (let el of svgdoc.getElementsByTagName("svg")) {
    >         let width = el.getAttribute("width");
    >         let height = el.getAttribute("height");
    >         let width_pt = width.match(/^([0-9]*)pt$/)[1];
    >         let height_pt = height.match(/^([0-9]*)pt$/)[1];
    >         let width_px = 5/4 * width_pt;
    >         let height_px = 5/4 * height_pt;
    >         object.setAttribute("width", width_px + "px");
    >         object.setAttribute("height", height_px + "px");
    >         found = true;

    So are you saying that Org is changing the size from px to pt?  Can you
    try to explain the problem you observe in words?


    The second rule of Fight Club is: You do not talk about Fight Club

reply via email to

[Prev in Thread] Current Thread [Next in Thread]