Code Monkey home page Code Monkey logo

Comments (15)

mgieseki avatar mgieseki commented on September 3, 2024 1

Aargh, that's another incompatible GS "improvement". They silently removed operator finddevice in GS 10.02.1:
https://bugs.ghostscript.com/show_bug.cgi?id=707307
I guess I need to find a workaround for it. At the moment, I can only suggest to use an older GS.

from dvisvgm.

johncbowman avatar johncbowman commented on September 3, 2024

The reason that dvisvm-2.13 was working with the current gs library is that it was compiled against an older default libgs (9.53).

Anyway, the solution is to upgrade to dvisvgm 3.2.1:
vectorgraphics/asymptote#434

This issue can presumably now be closed.

from dvisvgm.

zarniwhoop73 avatar zarniwhoop73 commented on September 3, 2024

Well, John, I'm glad it works for you. I have not yet found the missing piece of the jigsaw. I tried dvisvgm-3.2.1 after raising this issue, no change. Then I looked at fedora and found two patches for ghostscript fixing issues there, one of which sounded relevant. My ghostscript was vanilla, but after patching it I still get the failure.

from dvisvgm.

johncbowman avatar johncbowman commented on September 3, 2024

I was comparing to the 10.03.0 prerelease of ghostscript but dvisvgm 3.2.1 also works for me with gs 10.02.1.

from dvisvgm.

mgieseki avatar mgieseki commented on September 3, 2024

Unfortunately, I can't reproduce the error here. Could you isolate the actual issue with dvisvgm and provide a corresponding DVI/EPS file? As I don't know much about the internals of asy, I can't really tell what might go wrong during the conversion.

from dvisvgm.

johncbowman avatar johncbowman commented on September 3, 2024

Here's an example comparing 3.0.3, which fails, and 3.2.1, which works (for me):

dvisvgm --version
dvisvgm 3.0.3
[wizard: ~/camp master] dvisvgm test.dvi
The old, written in PostScript, PDF interpreter has been removed entirely.
You should cease using -dNEWDPF as it has no effect npre-processing DVI file (format version 2)
processing page 1
graphic size: 100.876875pt x 100.876875pt (35.454167mm x 35.454167mm)
output written to test.svg
1 of 1 page converted in 0.388851 seconds

dvisvgm --version
dvisvgm 3.2.1
[wizard: ~/camp master] dvisvgm test.dvi
pre-processing DVI file (format version 2)
processing page 1
graphic size: 100.876875pt x 100.876875pt (35.454167mm x 35.454167mm)
output written to test.svg
1 of 1 page converted in 0.0585079 seconds

test.dvi.gz

from dvisvgm.

mgieseki avatar mgieseki commented on September 3, 2024

Ok, thanks for the example file. As far as I can tell from the console output, both versions produce the same SVG file but dvisvgm 3.0.3 triggers the GS warning because it uses -dNEWPDF. This option was removed with GS 10.01.0 only after the release of dvisvgm 3.0.3. It shouldn't have any effect here, though, because there's nod PDF processing involved in this example. I suppose, Ken's issue seems to be something different.

from dvisvgm.

johncbowman avatar johncbowman commented on September 3, 2024

I see; the -dNEWDPF error message confused me.

As Ken reports, there still is an issue with dvisvgm 3.2.1:

[test.ps.gz](https://github.com/mgieseki/dvisvgm/files/14502394/test.ps.gz)

dvisvgm test.ps -E
processing EPS file
  PostScript error: undefined in finddeviceOperand stack:
      5  --nostringval--  --nostringval--  --nostringval--  imgdev  jpeg

from dvisvgm.

zarniwhoop73 avatar zarniwhoop73 commented on September 3, 2024

I do have a sphere_.pdf, presumably created during asy's rendering stage which either eventually generates the error message, or else succeeds and is then followed by the error message.

My dvisvgm was initially 3.2, now 3.2.1. My ghostscript is now 10.02.1 patched with two patches from fedora, PostScript-Fix-selectdevice.patch which looked hopeful (gs bug 707310), and txtwrite-device-needs-to-countdown-the-device-on-tex.patch which merely suppresses a debug message - but since I was patching I figured I'd take both.

I see John has now posted test.ps which also shows a similar failure but without creating a test_.pdf file.

from dvisvgm.

mgieseki avatar mgieseki commented on September 3, 2024

Unfortunately, I currently have no idea how to work around this issue. When I was looking for ways to implement the bitmap extraction back then, I already noticed that PS operator setpagedevice threw an error when called inside a redefinition of another operator. finddevice, on the other hand, worked flawlessly, so I used that one.
As I don't know why setpagedevice doesn't work here, I opened a ticket in the GS bug tracker:
https://bugs.ghostscript.com/show_bug.cgi?id=707645
Let's hope, they could provide some helpful feedback.

from dvisvgm.

mgieseki avatar mgieseki commented on September 3, 2024

I've implemented a workaround that works so far with my (few) tests. Could you please test the latest version from the master branch too? If there are no things missing, I'll create a new dvisvgm release.

from dvisvgm.

johncbowman avatar johncbowman commented on September 3, 2024

from dvisvgm.

zarniwhoop73 avatar zarniwhoop73 commented on September 3, 2024

That commit [https://github.com/mgieseki/dvisvgm/commit/40ff350d327d41f492beb1e9b0a88053822e5939] works nicely for me as well. Thank You so much to both of you.

from dvisvgm.

mgieseki avatar mgieseki commented on September 3, 2024

Great, thank you both for the feedback. I'm preparing a hotfix release and will upload it later today.

from dvisvgm.

mgieseki avatar mgieseki commented on September 3, 2024

I just uploaded dvisvgm 3.2.2 that contains the latest changes. If you find any further issues, please let me know.

from dvisvgm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.