From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Randby Subject: Re: Inline Images Export Bug Date: Wed, 26 Aug 2015 19:13:47 -0400 Message-ID: <55DE482B.20704@gmail.com> References: <55DDFCBF.2050202@gmail.com> <876141apq4.fsf@gmx.us> <87egip1zoe.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUjtA-00070x-S2 for emacs-orgmode@gnu.org; Wed, 26 Aug 2015 19:13:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUjt7-0005Er-IO for emacs-orgmode@gnu.org; Wed, 26 Aug 2015 19:13:52 -0400 Received: from mail-ig0-x233.google.com ([2607:f8b0:4001:c05::233]:35826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUjt7-0005EX-Dd for emacs-orgmode@gnu.org; Wed, 26 Aug 2015 19:13:49 -0400 Received: by igbjg10 with SMTP id jg10so53670829igb.0 for ; Wed, 26 Aug 2015 16:13:48 -0700 (PDT) Received: from [192.168.1.109] (cpe-184-56-99-2.neo.res.rr.com. [184.56.99.2]) by smtp.gmail.com with ESMTPSA id w26sm438185ioi.26.2015.08.26.16.13.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 16:13:48 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 > unnecessary. > > 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: > > > Sorry, your browser does not support SVG. > > 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 anything. > > 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 > wrote: > > Hi, > > Pip Cet > 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? > > Thanks, > Rasmus > > -- > The second rule of Fight Club is: You do not talk about Fight Club > >