Issue 9290 - Render EPS graphics without previews
Summary: Render EPS graphics without previews
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: open-import (show other issues)
Version: OOo 1.0.1
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: OOo 2.0.2
Assignee: wolframgarten
QA Contact: issues@graphics
URL:
Keywords: needhelp, oooqa
: 22113 22251 50447 54772 59327 (view as issue list)
Depends on:
Blocks:
 
Reported: 2002-11-16 21:39 UTC by Unknown
Modified: 2010-08-03 12:15 UTC (History)
10 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
a patch that attempts two fallbacks on external tools to make a good preview for eps. (12.18 KB, patch)
2004-12-14 16:09 UTC, caolanm
no flags Details | Diff
modified patch - uses convert instead of ghostscript (11.75 KB, patch)
2005-06-14 11:15 UTC, lohmaier
no flags Details | Diff
clophs stuff merged into my orig patch (13.85 KB, patch)
2005-06-16 13:54 UTC, caolanm
no flags Details | Diff
sample eps (604.38 KB, application/postscript)
2005-11-25 09:08 UTC, caolanm
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Unknown 2002-11-16 21:39:17 UTC
If I have a document open in the word processor and I import a eps graphic it
doesn't actually get drawn in the document display window. I have been told this
is because OpenOffice/Star/Office doesn't include a postscript renderer. Since
you are using ghostscript for printing (at least on Linux) why not use it as a
postscript renderer too? I just tried this with OpenOffice643 and it draws a
bounding box where the graphic would appear but not the actual graphic.
Comment 1 lohmaier 2002-11-18 17:53:26 UTC
Why not include a preview-image in the eps? OOo can then display the
preview image.
It is not true that OOo uses ghostscript for printing. OOo creates
postscript itself. ghostscript is in turn used by your printing system.
OOo is using ghostscript to create pdf-files (in the next release
there will be native-pdf export - so gs is then not used/needed anymore).

I myself think that implementing a ps renderer would not make much
sense, since all you have to do is create eps with preview (that's why
it is possible to add a preview to eps).
If you insist on your RFE, then please tell me.
Comment 2 hassmanm 2003-05-05 09:14:06 UTC
Yes, if you have a preview in EPS, tihs is correctly displayed. But if
you print such document on non-postscript printer, only this preview
is printed - if this EPS contains some text - the quality is much
decreased.

Such OpenOffice document is not full transferable between users. Some
user has poscscript printer, some not.
Comment 3 stefan.baltzer 2003-06-04 14:21:19 UTC
Reassigned to Bettina.
Comment 4 guido.pinkernell 2004-02-14 19:36:42 UTC
This is a rather old RFE which has been duplicated with some other Issues in the
meantime. Have searched Issuezilla for a "Render EPS" request that has been set
to New. There is none. As this seems to be a reasonable request I will set this
to new and will close the other as duplicates of this.
Comment 5 guido.pinkernell 2004-02-14 19:37:33 UTC
*** Issue 22251 has been marked as a duplicate of this issue. ***
Comment 6 guido.pinkernell 2004-02-14 19:42:03 UTC
Summary changed following the reporters intentions as expresses in comment dated
May 2003
Comment 7 guido.pinkernell 2004-02-14 19:47:34 UTC
*** Issue 22113 has been marked as a duplicate of this issue. ***
Comment 8 caolanm 2004-12-13 11:49:38 UTC
If people embed eps files that do not have previews into a document, and use the
OOo Export as PDF function then they'll get the placeholder graphic rather than
the rendered eps, seeing as there isn't an eps rendered in OOo. Is that correct ?
Comment 9 lohmaier 2004-12-13 20:38:28 UTC
Yes this is correct when using the native PDF-export. See issue 14163
Comment 10 caolanm 2004-12-14 16:09:31 UTC
Created attachment 20510 [details]
a patch that attempts two fallbacks on external tools to make a good preview for eps.
Comment 11 caolanm 2004-12-14 16:12:34 UTC
The attached patch tries to use pstoedit to make a very nice quality emf preview
if one is missing, and then falls back to trying to make a not so good png one
with ghostscript to png.
(https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=142535)

How about that for a relatively painfree solution ?
Comment 12 bettina.haberer 2005-05-20 14:59:15 UTC
Retarget to OO.o 2.0.1.
Comment 13 lohmaier 2005-05-22 23:41:23 UTC
I find convert (from ImageMagick) more robust/not so picky about the input
compared to using ghostscript directy.

With ghostscript I had bounding-box troubles (I ended up with a white "preview"
because the real image was offset out of the visible area) with ghostscript that
I did not have when using convert so I modified the attached patch to use
convert instead of ghostscript - you can even specify a density/resolution value.

The good thing about this issue is that the preview is stored within the
document so it is available to OOo versions that don't have this patch applied.
(And this is the drawback as well since the filesize increases because of this
preview)

##############
Summary:
I'd appreciate if another fallback would be introduced:
 1st try pstoedit, then convert, then ghostscript
or just replace the ghostscript-solution by the convert one.
Comment 14 lohmaier 2005-06-07 22:09:57 UTC
*** Issue 50447 has been marked as a duplicate of this issue. ***
Comment 15 caolanm 2005-06-14 09:59:38 UTC
cloph: can you attach the modified patch to use convert as well ? In #i14163#
thb proposes that I go ahead with the patch.
Comment 16 lohmaier 2005-06-14 11:14:02 UTC
Since I adapted the patch only for myself, I did not *add* convert, but simply
replaced the ghostscript-command with a convert-command.

Also note that I did not properly adapt the ifdef windows case!
Comment 17 lohmaier 2005-06-14 11:15:16 UTC
Created attachment 27158 [details]
modified patch - uses convert instead of ghostscript
Comment 18 bettina.haberer 2005-06-16 13:48:04 UTC
Hi Thorsten, please take this patch to your ownership. Thank you. Having spoken
about I think this is no OO.o 2.0.1 issue.
Comment 19 caolanm 2005-06-16 13:54:21 UTC
Created attachment 27236 [details]
clophs stuff merged into my orig patch
Comment 20 thb 2005-06-18 01:48:17 UTC
@bh: indeed. At least for myself, I probably won't make it for 2.0.1, especially
since the Windows side is still open.  Retargetted to OOo later, but set
'needhelp' keyword - if somebody is willing to implement and QA a fully working
cross-platform solution, I'll be happy to take that into an earlier release.
Comment 21 lohmaier 2005-06-20 18:26:25 UTC
? What is the problem with windows? ghostscript exists for windows, ImageMagick
(=convert) exists for windows and even pstoedit is available for windows.

So the exact same mechanism is used on linux and windows.

This solution is cross-platform and is working fine.

IMHO the helper-programs should /always/ be used, not only if there is no
preview available. When the helper-programs are not installed, it doesn't mean
loosing anything, it falls back to drawing the red-box.
Comment 22 thb 2005-06-20 18:36:29 UTC
@cloph: I'm well aware of that, but consider the probability of having pstoedit
in the %PATH on Windows to be extremely low - in contrast to *nix.
Comment 23 fbissey 2005-09-16 02:14:11 UTC
I am personnaly against using convert for handling eps.
I am frustrated with the inability of OOo to handle eps
properly in linux. I usually use latex so it is usually not a 
problem but when I have to use OOo it is a pain. 
I thought I could just use convert to transform my eps in png
or jpg or whatever. The problem is those format are not vector 
format and don't scale well. I often need to rescale those eps 
figures (Mathematica export microscopic figures whatever the format).
I thought I could use "convert -resize xxx%" to make a bigger
figure that I could then scale down, unfortunately it converts the 
vector graphic to a bitmap and then resize the bitmap (even if 
you want to resize an eps to an eps) which makes again an ugly
figure.
Comment 24 thb 2005-09-16 11:06:56 UTC
@fbissey: and naked ghostscript produces better output for your testcases?
Comment 25 lohmaier 2005-09-16 12:21:53 UTC
@fbissey:

If you use the wrong parameters, you cannot expect a decent result. Resize alone
is not enough. Much more important is the density (that is what I use in my
patch). For more details please read the ImageMagick manpage.
When blowing up a 72dpi image (that is the default density when not specified
otherwise) it is not surprising that you'll get a pixelated result.

##############
@thb: You wrote:
> I'm well aware of that, but consider the probability of having pstoedit
> in the %PATH on Windows to be extremely low - in contrast to *nix.

Not necessarily. I don't know pstoedit, but other software such as GTK set the
path accordingly.

And even if it would not find one of the helper programs: You'd simply get the
old behaviour with the red box. I don't really see that as a drawback.
Comment 26 thb 2005-10-21 12:26:21 UTC
*** Issue 54772 has been marked as a duplicate of this issue. ***
Comment 27 zehavoc 2005-10-30 20:12:00 UTC
Seriously ? I have to patch recompile  and OpenOffice by hand now ?
I don't know, I've heard the compile process is very long and I had to send my
work tomorow morning :(

Maybe you can't point me to a binary version of OpenOffice where the patch has
already been applied ?
Comment 28 lohmaier 2005-11-20 00:43:59 UTC
thb - what is your opinion?

Even when the programs are not available on windows, the patch doesn't remove
functionality for those systems and doesn't render the files incompatible.

#####
@thb: You wrote:
> I'm well aware of that, but consider the probability of having pstoedit
> in the %PATH on Windows to be extremely low - in contrast to *nix.

Not necessarily. I don't know pstoedit, but other software such as GTK set the
path accordingly.

And even if it would not find one of the helper programs: You'd simply get the
old behaviour with the red box. I don't really see that as a drawback.
#####

I can only see benefits (even though not everyone can benefit from it without
installing additional software).
ImageMagick has a windows-binary version with installer that does set up
everything necessary.
So please rethink the target (I'd love to see this is 2.0.2 - I used the patch
with every version I compiled and could not see any regression)
Comment 29 thb 2005-11-21 11:05:02 UTC
@cloph: this was even scheduled for 2.0 - in principle, I have no problems with
this patch, I even asked cmc whether he would champion to add that to one of his
CWS. Thus, as always: if time permits, 2.0.2 is possible.
Comment 30 caolanm 2005-11-22 12:11:52 UTC
oky doky, I propose to do the "try some external programs to make a preview"
patch under this id. issue 14163 can be left for some alternative native OOo
solution.
Comment 31 caolanm 2005-11-22 12:44:03 UTC
done in epspreview. will build installsets and make up a testcase
Comment 32 caolanm 2005-11-22 13:07:30 UTC
change component
Comment 33 caolanm 2005-11-25 09:08:36 UTC
Created attachment 31784 [details]
sample eps
Comment 34 caolanm 2005-12-05 12:41:24 UTC
reopen for qa
Comment 35 caolanm 2005-12-05 12:42:13 UTC
reassign
Comment 36 caolanm 2005-12-05 12:43:23 UTC
implemented in epspreview
Comment 37 wolframgarten 2005-12-14 09:50:38 UTC
*** Issue 59327 has been marked as a duplicate of this issue. ***
Comment 38 wolframgarten 2006-01-06 14:18:12 UTC
Verified. 
Comment 39 lohmaier 2006-01-26 23:34:20 UTC
*** Issue 61182 has been marked as a duplicate of this issue. ***
Comment 40 caolanm 2006-02-09 16:26:45 UTC
closed, in master
Comment 41 nico_59 2006-06-14 22:44:38 UTC
I tried OpenOffice 2.0.2 on Windows XP SP2 and the problem is not solved.
When I print an eps image produced by matplotlib, I get a red rectangle with
some text inside :
"Title:C:\Documents and Settings\
Creator:matplotlib version 0.87.2, http:
CreationDate:Wed Jun 14 22:30:44 2006"

(This works with MsWord for example)
Comment 42 msundman 2008-05-11 02:51:15 UTC
Why is this CLOSED/FIXED? OOo Draw 2.4 most certainly does NOT render EPS 
images, but uses the awful, low-resolution bitmap preview embedded in it.
Comment 43 edgar_holleis 2008-10-27 17:44:01 UTC
Strange behaviour OO3/Windows:

summary: it does not work

- path is searched for: pstoedit, convert and gswin32c, first without then with
exe suffix
- if any of the executables are found, they execute with correct command line
and they do the right thing (verified with procmon)
- still no preview appears in openoffice
- is there a problem with i/o-redirection?

another anomaly:
- oo3 disregards the order of search paths in the %PATH% environment variable
and always searches c:\windows\system32 first, where it findes convert.exe,
which is a Windows filesystem tool.
Comment 44 afritz 2010-08-03 12:15:32 UTC
Can you please integrate the ability to use EPS graphics native in 
OpenOffice.org? It is not working in 3.2.1. Only a placeholder is shown.
Thanks.