Possible bug in writeDotImageMapFromFile()

"Stormont, Brian" <[email protected]> Mon, 9 Mar 2015 11:46:32 -0500
Newsgroups gmane.text.doxygen.devel
Message-ID <D12346A8.56504%[email protected]>
--===============4522983720897745781==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_D12346A856504bstormontzebracom_"

--_000_D12346A856504bstormontzebracom_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

While using the \dot and \dotfile commands, I ran across a potential bug in=
 writeDotImageMapFromFile() in dot.cpp.  The following is a snippet of the =
existing code:


  if (imgExt=3D=3D"svg") // vector graphics

  {

    //writeSVGFigureLink(t,relPath,inFile,inFile+".svg");

    //DotFilePatcher patcher(inFile+".svg");

    QCString svgName=3DoutDir+"/"+baseName+".svg";

    writeSVGFigureLink(t,relPath,baseName,svgName);

    DotFilePatcher patcher(svgName);

    patcher.addSVGConversion(relPath,TRUE,context,TRUE,graphId);

    patcher.run();

  }

Note that the SVG file link is created *before* the SVG file is patched wit=
h the svgpan.js support.   As a result, for any \dot or \dotfile that has a=
 resulting large size, the iframe link generated by writeSVGFigureLink() wi=
ll be forced to the actual dimensions of the SVG (potentially thousands of =
pixels wide), so the svgpan.js will not provide any useful functionality an=
d viewing the resulting embedded SVG is unwieldy.

Moving the writeSVGFigureLink() to *after* the call to patcher.run() produc=
es better HTML results where the embedded SVG is put in an HTML iframe with=
 "width=3D100%" rather than the original SVG width, however I wasn't sure i=
f doing so would have any adverse effects.

Thanks,
Brian




________________________________
- CONFIDENTIAL-

This email and any files transmitted with it are confidential, and may also=
 be legally privileged. If you are not the intended recipient, you may not =
review, use, copy, or distribute this message. If you receive this email in=
 error, please notify the sender immediately by reply email and then delete=
 this email.

--_000_D12346A856504bstormontzebracom_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
</head>
<body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-lin=
e-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-fami=
ly: 'Source Sans Pro', sans-serif;">
<div>Hi,</div>
<div><br>
</div>
<div>While using the \dot and \dotfile commands, I ran across a potential b=
ug in&nbsp;<span style=3D"font-family: Menlo; font-size: 11px;">writeDotIma=
geMapFromFile</span>() in dot.cpp. &nbsp;The following is a snippet of the =
existing code:</div>
<div><br>
</div>
<div>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0,=
 132, 0);">
<span style=3D"font-variant-ligatures: no-common-ligatures; color: #000000"=
>&nbsp;&nbsp;</span><span style=3D"font-variant-ligatures: no-common-ligatu=
res; color: #bb2ca2">if</span><span style=3D"font-variant-ligatures: no-com=
mon-ligatures; color: #000000"> (imgExt=3D=3D</span><span style=3D"font-var=
iant-ligatures: no-common-ligatures; color: #d12f1b">&quot;svg&quot;</span>=
<span style=3D"font-variant-ligatures: no-common-ligatures; color: #000000"=
>)
</span>// vector graphics</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo;">&nbsp; {</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0,=
 132, 0);">
<span style=3D"font-variant-ligatures: no-common-ligatures; color: #000000"=
>&nbsp; &nbsp; </span>
//writeSVGFigureLink(t,relPath,inFile,inFile&#43;&quot;.svg&quot;);</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0,=
 132, 0);">
<span style=3D"font-variant-ligatures: no-common-ligatures; color: #000000"=
>&nbsp; &nbsp; </span>
//DotFilePatcher patcher(inFile&#43;&quot;.svg&quot;);</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo;">&nbsp; &nbsp=
; QCString svgName=3DoutDir&#43;<span style=3D"font-variant-ligatures: no-c=
ommon-ligatures; color: #d12f1b">&quot;/&quot;</span>&#43;baseName&#43;<spa=
n style=3D"font-variant-ligatures: no-common-ligatures; color: #d12f1b">&qu=
ot;.svg&quot;</span>;</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo;">&nbsp; &nbsp=
; writeSVGFigureLink(t,relPath,baseName,svgName);</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo;">&nbsp; &nbsp=
; DotFilePatcher patcher(svgName);</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo;">&nbsp; &nbsp=
; patcher.addSVGConversion(relPath,<span style=3D"font-variant-ligatures: n=
o-common-ligatures; color: #bb2ca2">TRUE</span>,context,<span style=3D"font=
-variant-ligatures: no-common-ligatures; color: #bb2ca2">TRUE</span>,graphI=
d);</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo;">&nbsp; &nbsp=
; patcher.run();</p>
<p style=3D"margin: 0px; font-size: 11px; font-family: Menlo;">&nbsp; }</p>
</div>
<div><br>
</div>
<div>Note that the SVG file link is created *before* the SVG file is patche=
d with the svgpan.js support. &nbsp; As a result, for any \dot or \dotfile =
that has a resulting large size, the iframe link generated by writeSVGFigur=
eLink() will be forced to the actual
 dimensions of the SVG (potentially thousands of pixels wide), so the svgpa=
n.js will not provide any useful functionality and viewing the resulting em=
bedded SVG is unwieldy.</div>
<div><br>
</div>
<div>Moving the writeSVGFigureLink() to *after* the call to patcher.run() p=
roduces better HTML results where the embedded SVG is put in an HTML iframe=
 with &quot;width=3D100%&quot; rather than the original SVG width, however =
I wasn't sure if doing so would have any adverse
 effects.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Brian&nbsp;</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<br>
<hr>
<font face=3D"Arial" color=3D"Gray" size=3D"1">- CONFIDENTIAL-<br>
<br>
This email and any files transmitted with it are confidential, and may also=
 be legally privileged. If you are not the intended recipient, you may not =
review, use, copy, or distribute this message. If you receive this email in=
 error, please notify the sender
 immediately by reply email and then delete this email.<br>
</font>
</body>
</html>

--_000_D12346A856504bstormontzebracom_--


--===============4522983720897745781==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
--===============4522983720897745781==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Doxygen-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doxygen-develop

--===============4522983720897745781==--