Bug 147592

Summary: eps looks toataly broken when opened with Karbon
Product: [Applications] karbon Reporter: Christian Boltz <kde-bugs>
Component: generalAssignee: Jan Hambrecht <jaham>
Status: REPORTED ---    
Severity: normal CC: bvbfan
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: the problematic EPS file, gzipped
screenshot showing rendering in KGhostView and Karbon14
Load EPS files correctly
Screenshot with Karbon 3.1.0

Description Christian Boltz 2007-07-06 00:34:32 UTC
Version:           1.6.0 (using KDE 3.5.7 "release 2.1" , openSUSE 10.2)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.18.8-0.3-default

I have a strange problem with Karbon14 and a specific EPS file (attached):

When I open this file in KGhostView (or gv), it is displayed as expected.
When I open this file in Karbon14, it is broken (as in "looks very different").

I'll attach the problematic EPS file and a screenshot showing snapshots from KGhostView (aka "expected result") and Karbon14 (aka "actual result").

This bug is reproducable with koffice-illustration-1.6.0-30 (KDE 3.5.7 from buildservice) on openSUSE 10.2.

Sidenote: I did not create this EPS file myself and unfortunately also don't know how it was created.
Comment 1 Christian Boltz 2007-07-06 00:35:23 UTC
Created attachment 21066 [details]
the problematic EPS file, gzipped
Comment 2 Christian Boltz 2007-07-06 00:36:16 UTC
Created attachment 21067 [details]
screenshot showing rendering in KGhostView and Karbon14
Comment 3 Tim Beaulen 2008-05-18 11:23:03 UTC
The problem with EPS or PS is that it's an extremly difficult file format.
But, there exists a great tool called GhostScript.

Both KGhostView and Karbon use GhostScript to interpret a PS or EPS file.
Karbon however converts it first to the Illustrator format.

So there are a couple of problems that can arise:
1. The conversion from EPS to Illustrator isn't perfect
2. The import filter for Illustrator isn't perfect.



Luckely there are some existing solutions:

1. Using pstoedit and skencil
   a. Use pstoedit to convert the EPS file to the Skencil format:
      pstoedit -f sk inputfile.eps outputfile.sk
   b. Use the Skencil convertion utility to convert from the Skencil format to SVG
      skconvert inputfile.sk outputfile.svg

I tested this and it works very well.
The disadvantage is that you need to install a great deal of other packages to make pstoedit and skencil run. And this might not be what you want.

2. Using Poppler
   a. Use Poppler to open a PDF or EPS file.
   b. Create a PDF import filter to create an ODF document.

I've not yet looked into this, but this is the technique used by PDF2SVG:
http://www.cityinthesky.co.uk/pdf2svg.html



Why not use the SVG conversion of pstoedit directly?
Example: pstoedit -f svg-plot inputfile.eps outputfile.svg
Well, it doesn't work. It doesn't create a valid svg file.


In my opinion, for the short term, if EPS has to be available in Karbon soon, then the first solution using pstoedit and skencil is the best solution.
In the long term, a dedicated PDF import filter using Poppler would be very nice.
Comment 4 Tim Beaulen 2008-05-18 11:42:24 UTC
Update:
Seems Poppler can't directly open an EPS file.
Comment 5 Jan Hambrecht 2008-05-18 13:53:28 UTC
Yes i think the preferred solution would be to create a pdf import filter (which is a must have anyway) and convert ps files to pdf which then can be imported. The pdf import filter is on the TODO of karbon already.
Comment 6 Tim Beaulen 2008-05-18 15:26:49 UTC
Created attachment 24822 [details]
Load EPS files correctly
Comment 7 Tim Beaulen 2008-05-18 15:28:30 UTC
Above is a patch to load EPS files correctly using pstoedit and skconvert.

It's not fast, at least with the resolution I've used for clipping.
Maybe that can be made user adjustable in a window.

Here's the result:
http://img234.imageshack.us/img234/6748/karbonepsgv0.png
Comment 8 Andrew Crouthamel 2018-11-02 04:17:59 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Andrew Crouthamel 2018-11-16 02:37:56 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 10 Christian Boltz 2018-11-16 11:20:43 UTC
Created attachment 116341 [details]
Screenshot with Karbon 3.1.0
Comment 11 Christian Boltz 2018-11-16 11:22:36 UTC
It looks better in current Karbon (3.1.0), but there are still some serious rendering errors - see the screenshot I just attached.
Comment 12 Anthony Fieroni 2019-06-04 20:13:30 UTC
I don't get it, you apply a patch or what file you use?