Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-27 Thread Scott Kostyshak
On Mon, Jun 26, 2017 at 09:50:30AM -0400, Cris Fuhrman wrote:
> On Sun, Jun 25, 2017 at 7:41 PM, Scott Kostyshak  wrote:
> 
> > I'm not sure exactly what happens and if there is platform-specific
> > behavior. To see the discussion I was referencing, see:
> >
> > https://www.lyx.org/trac/ticket/9778
> 
> 
> Thanks for the details. Clearly LyX is trying to render SVG without using
> conversion rules. In https://www.lyx.org/trac/ticket/9778#comment:10 a
> work-around to force LyX to use the conversion rules is to remove a library
> file. I tried this on my Windows 10 (it's a DLL) and it breaks the GUI of
> LyX.
> 
> Because SVG is a moving standard (1.1 is last official one and was released
> in 2011, 1.2 is still a draft, Tiny 1.2 exists as a separate standard, 2.x
> is still in draft mode, etc.), LyX users should have more control over how
> SVG is rendered with the tool they prefer. SVG is not like GIF or JPEG
> (yet).
> 
> I see there was already a patch
> https://www.lyx.org/trac/changeset/6bd5263405/lyxgit that was supposed to
> make this work. But from my experiences with 2.2.3 in Windows, it doesn't
> seem to be working (anymore).
> 
> Would it be constructive to make a feature request in LyX to allow the
> option of bypassing native SVG rendering?

Enrico proposed a patch for stable that might make it in 2.2.4 [1]. If
you think there's room for improvement, yes please go ahead and make
a separate feature request.

Scott


Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-26 Thread Cris Fuhrman
On Sun, Jun 25, 2017 at 7:41 PM, Scott Kostyshak  wrote:

> I'm not sure exactly what happens and if there is platform-specific
> behavior. To see the discussion I was referencing, see:
>
> https://www.lyx.org/trac/ticket/9778


Thanks for the details. Clearly LyX is trying to render SVG without using
conversion rules. In https://www.lyx.org/trac/ticket/9778#comment:10 a
work-around to force LyX to use the conversion rules is to remove a library
file. I tried this on my Windows 10 (it's a DLL) and it breaks the GUI of
LyX.

Because SVG is a moving standard (1.1 is last official one and was released
in 2011, 1.2 is still a draft, Tiny 1.2 exists as a separate standard, 2.x
is still in draft mode, etc.), LyX users should have more control over how
SVG is rendered with the tool they prefer. SVG is not like GIF or JPEG
(yet).

I see there was already a patch
https://www.lyx.org/trac/changeset/6bd5263405/lyxgit that was supposed to
make this work. But from my experiences with 2.2.3 in Windows, it doesn't
seem to be working (anymore).

Would it be constructive to make a feature request in LyX to allow the
option of bypassing native SVG rendering?


Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-25 Thread Scott Kostyshak
On Sun, Jun 25, 2017 at 04:54:52PM -0400, Cris Fuhrman wrote:
> On Sun, Jun 25, 2017 at 4:24 PM, Scott Kostyshak  wrote:
> 
> > Qt has
> > problems with some (valid) SVG files and only supports a certain
> > implementation of the SVG fileformat.
> >
> 
> Can you confirm that Qt is overriding the SVG -> PNG conversion in LyX
> 2.2.3? This seems like a bug to me, for reasons that I pointed out here.
> Not the end of the world, but 2.2.3 is a small step back for me if this is
> something new.

I'm not sure exactly what happens and if there is platform-specific
behavior. To see the discussion I was referencing, see:

https://www.lyx.org/trac/ticket/9778

Scott


signature.asc
Description: PGP signature


Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-25 Thread Cris Fuhrman
On Sun, Jun 25, 2017 at 4:24 PM, Scott Kostyshak  wrote:

> Qt has
> problems with some (valid) SVG files and only supports a certain
> implementation of the SVG fileformat.
>

Can you confirm that Qt is overriding the SVG -> PNG conversion in LyX
2.2.3? This seems like a bug to me, for reasons that I pointed out here.
Not the end of the world, but 2.2.3 is a small step back for me if this is
something new.


Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-25 Thread Scott Kostyshak
On Thu, Jun 22, 2017 at 05:24:42PM -0400, Paul A. Rubin wrote:

> So apparently there's something "off" about the SVG files that caused LyX to
> spit up the error messages, and maybe there is similarly something different
> about Cris's images.

Or it could be that the SVG files are different SVG versions. Qt has
problems with some (valid) SVG files and only supports a certain
implementation of the SVG fileformat.

Scott


Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-22 Thread Paul A. Rubin

On 06/22/2017 01:55 PM, Paul A. Rubin wrote:

On 06/22/2017 12:13 PM, Cris Fuhrman wrote:


While debugging some issues with SVG converters, I'm a bit confused 
now. I had configured an SVG -> PNG conversion rule in my 
preferences, hoping to control the tool that will visualize my SVG 
images when editing in LyX. Sadly, it seems that LyX is not applying 
the rule anymore. Here's the message log info:


graphics/GraphicsCacheItem.cpp (416): Converting it to format.

Format.cpp (393): filetools(getFormatFromContents)

Couldn't find a known format!

Format.cpp (504): will guess format from file extension: svg -> svg

graphics/GraphicsCacheItem.cpp (386):
[CacheItem::Impl::convertToDisplayFormat]

Attempting to convert image file: C:/REDACTED.svg

with displayed filename: C:/REDACTED.svg

Format.cpp (393): filetools(getFormatFromContents)

Couldn't find a known format!

Format.cpp (504): will guess format from file extension: svg -> svg

graphics/GraphicsCacheItem.cpp (393):

The file contains svg format data.

graphics/GraphicsCacheItem.cpp (398): No conversion needed (from
== to)!

graphics/GraphicsCacheItem.cpp (295): Loading image.

graphics/GraphicsCacheItem.cpp (301): Image loading succeeded.


I just checked with LyX 2.2.3 on Linux Mint, and the same thing 
happens to me (minus the part about Inkscape, which I do not have 
installed). LyX claims to have the ability to display SVG files 
directly, says it's doing a non-conversion (from == to) and then can't 
convert the file.


I'd be inclined to suspect a missing library, but I have libqt4-svg 
and libqt4-svg:i386 installed, along with a half-dozen other SVG 
libraries. That said, GIMP shows my test file as a blank canvas, and 
the default image viewer will not load it.
Okay, I partially retract what I said. I don't have a lot of SVG files 
lying around, and the first ones I tested (all from the same source) 
generated exactly the same error messages Cris reported.


Just now, though, I tried a few others I tracked down on my drive, 
including some .svgz files provided by LyX (in /usr/share/lyx/images on 
Linux systems) and the only .svg file I could find from LyX 
(/usr/share/lyx/doc/clipart/SVG-Drawing.svg). They all worked fine, as 
did a non-LyX SVG file I found in one of my folders.


So apparently there's something "off" about the SVG files that caused 
LyX to spit up the error messages, and maybe there is similarly 
something different about Cris's images.


Paul



Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-22 Thread Kornel Benko
Am Donnerstag, 22. Juni 2017 um 12:13:26, schrieb Cris Fuhrman 

> Hello,
> 
> While debugging some issues with SVG converters, I'm a bit confused now. I
> had configured an SVG -> PNG conversion rule in my preferences, hoping to
> control the tool that will visualize my SVG images when editing in LyX.
> Sadly, it seems that LyX is not applying the rule anymore. Here's the
> message log info:
> 

To my understanding, we depend on QT to do the convert for us.
For it to work, we have to install the appropriate svg module.
On debian-linuxes the needed packages are:
libqt4-svg (for QT 4.8)
libqt5svg5 (for QT 5.x)
Without this, display of svg-images is not working.
Kornel

signature.asc
Description: This is a digitally signed message part.


Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-22 Thread Paul A. Rubin

On 06/22/2017 12:13 PM, Cris Fuhrman wrote:

Hello,

While debugging some issues with SVG converters, I'm a bit confused 
now. I had configured an SVG -> PNG conversion rule in my preferences, 
hoping to control the tool that will visualize my SVG images when 
editing in LyX. Sadly, it seems that LyX is not applying the rule 
anymore. Here's the message log info:


graphics/GraphicsCacheItem.cpp (416): Converting it to format.

Format.cpp (393): filetools(getFormatFromContents)

Couldn't find a known format!

Format.cpp (504): will guess format from file extension: svg -> svg

graphics/GraphicsCacheItem.cpp (386):
[CacheItem::Impl::convertToDisplayFormat]

Attempting to convert image file: C:/REDACTED.svg

with displayed filename: C:/REDACTED.svg

Format.cpp (393): filetools(getFormatFromContents)

Couldn't find a known format!

Format.cpp (504): will guess format from file extension: svg -> svg

graphics/GraphicsCacheItem.cpp (393):

The file contains svg format data.

graphics/GraphicsCacheItem.cpp (398): No conversion needed (from
== to)!

graphics/GraphicsCacheItem.cpp (295): Loading image.

graphics/GraphicsCacheItem.cpp (301): Image loading succeeded.



Here are my questions:

  * Which tool is converting my SVG to show on the screen if the log
says "No conversion needed"? Are SVG files now somehow "native" to
LyX 2.2.3?
  * Is it not the SVG -> PNG rule I should be overriding?
  * Why is my SVG -> PNG converter (the one I thought should be
executed) being ignored?

The reason I need to do this is that the rendering of flowed (wrapped) 
text in SVG (something I use quite a lot in figures) is very dependent 
on the converter. Inkscape lets me edit pretty well, but I'd been 
having issues with it hanging and so I switched it to rsvg-convert 
while debugging. That tool doesn't quite handle wrapped text so well, 
as it is a controversial (moving target) part of the standard. See 
http://wiki.inkscape.org/wiki/index.php/Frequently_asked_questions#What_about_flowed_text.3F


My SVG -> PDF (pdf2latex) etc. overrides seem to work just fine when I 
test.
I just checked with LyX 2.2.3 on Linux Mint, and the same thing happens 
to me (minus the part about Inkscape, which I do not have installed). 
LyX claims to have the ability to display SVG files directly, says it's 
doing a non-conversion (from == to) and then can't convert the file.


I'd be inclined to suspect a missing library, but I have libqt4-svg and 
libqt4-svg:i386 installed, along with a half-dozen other SVG libraries. 
That said, GIMP shows my test file as a blank canvas, and the default 
image viewer will not load it.


FWIW,
Paul



Re: LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-22 Thread Scott Kostyshak
On Thu, Jun 22, 2017 at 12:13:26PM -0400, Cris Fuhrman wrote:
> Hello,
> 
> While debugging some issues with SVG converters, I'm a bit confused now. I
> had configured an SVG -> PNG conversion rule in my preferences, hoping to
> control the tool that will visualize my SVG images when editing in LyX.
> Sadly, it seems that LyX is not applying the rule anymore.

Anymore after what? After an upgrade of LyX?

Have you tried using Insert > File > External Materials and choosing
"Inkscape figure"? I wonder if that will work better for your workflow.

Scott


LyX 2.2.3, Windows 10 and showing SVG in the editor

2017-06-22 Thread Cris Fuhrman
Hello,

While debugging some issues with SVG converters, I'm a bit confused now. I
had configured an SVG -> PNG conversion rule in my preferences, hoping to
control the tool that will visualize my SVG images when editing in LyX.
Sadly, it seems that LyX is not applying the rule anymore. Here's the
message log info:

graphics/GraphicsCacheItem.cpp (416): Converting it to format.
>
> Format.cpp (393): filetools(getFormatFromContents)
>
> Couldn't find a known format!
>
> Format.cpp (504): will guess format from file extension: svg -> svg
>
> graphics/GraphicsCacheItem.cpp (386):
> [CacheItem::Impl::convertToDisplayFormat]
>
> Attempting to convert image file: C:/REDACTED.svg
>
> with displayed filename: C:/REDACTED.svg
>
> Format.cpp (393): filetools(getFormatFromContents)
>
> Couldn't find a known format!
>
> Format.cpp (504): will guess format from file extension: svg -> svg
>
> graphics/GraphicsCacheItem.cpp (393):
>
> The file contains svg format data.
>
> graphics/GraphicsCacheItem.cpp (398): No conversion needed (from == to)!
>
> graphics/GraphicsCacheItem.cpp (295): Loading image.
>
> graphics/GraphicsCacheItem.cpp (301): Image loading succeeded.
>
>
>
Here are my questions:

   - Which tool is converting my SVG to show on the screen if the log says
   "No conversion needed"? Are SVG files now somehow "native" to LyX 2.2.3?
   - Is it not the SVG -> PNG rule I should be overriding?
   - Why is my SVG -> PNG converter (the one I thought should be executed)
   being ignored?

The reason I need to do this is that the rendering of flowed (wrapped) text
in SVG (something I use quite a lot in figures) is very dependent on the
converter. Inkscape lets me edit pretty well, but I'd been having issues
with it hanging and so I switched it to rsvg-convert while debugging. That
tool doesn't quite handle wrapped text so well, as it is a controversial
(moving target) part of the standard. See
http://wiki.inkscape.org/wiki/index.php/Frequently_asked_questions#What_about_flowed_text.3F

My SVG -> PDF (pdf2latex) etc. overrides seem to work just fine when I
test.