Issue 20085 - wmf image badly exported to pdf
Summary: wmf image badly exported to pdf
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC4
Hardware: PC Windows 2000
: P3 Trivial (vote)
Target Milestone: ---
Assignee: christian.guenther
QA Contact: issues@sw
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2003-09-25 16:45 UTC by shivan
Modified: 2013-08-07 14:43 UTC (History)
1 user (show)

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


Attachments
example file with wmf inside (8.36 KB, application/octet-stream)
2003-09-25 16:47 UTC, shivan
no flags Details
the result by exporting to pdf (37.36 KB, application/octet-stream)
2003-09-25 16:47 UTC, shivan
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description shivan 2003-09-25 16:45:53 UTC
when exporting the wmf (see attachment) to pdf, you'll get a black box instead 
of the transparency. But the writer displays it correctly. And print preview is 
okay, too.
Comment 1 shivan 2003-09-25 16:47:18 UTC
Created attachment 9667 [details]
example file with wmf inside
Comment 2 shivan 2003-09-25 16:47:58 UTC
Created attachment 9668 [details]
the result by exporting to pdf
Comment 3 utomo99 2003-11-01 03:49:27 UTC
I can Reproduce the problem on 
OpenOffice 1.1 (default Install, US), Win XP Pro Sp1. 
(And MS Office XP Sp2). 
It is real problem

when exporting the file to pdf, the transparency is gone. Look at the
Chain image. 
Comment 4 h.ilter 2003-11-03 12:03:30 UTC
OOo 1.1.1 approved by TZ
Comment 5 philipp.lohmann 2003-11-04 16:56:25 UTC
pl->sj: This is actually not a PDF export bug, it happens also when
printing. The reason for the black rectangle around the chain element
is that the chain element is actually drawn as three bitmaps; first a
BitmapEx, then a Bitmap, then a BitmapEx again. The middle operation
is obviously the culprit: it should be an BitmapEx with black as
transparent color (setting the corresponding transparence in
PDFExport::ImplWriteBitmapEx solves the problem).

As far as i can see the Metafile contains a META_BMPSCALE_ACTION where
it should probably be a META_BMPEXSCALE_ACTION; this IMHO means that
the paint routine of the application uses DrawBitmap where it should
DrawBitmapEx; alternatively this may be inside the WMF import.

Could you please look into this and dispatch to the appropriate
developer ?
Comment 6 sven.jacobi 2003-11-04 17:08:44 UTC
SJ->THB: It seems that we have some problems with rasterops. Can you
please takeover this bug.
Comment 7 thb 2003-12-01 15:34:24 UTC
Yep, it's indeed a raster op problem. Actually, a pattern raster op is
involved here, for which we don't have any workaround in place
currently (for src/dst only ROPs, we have). Evaluating the semantics
at the moment.
Comment 8 thb 2003-12-01 16:22:03 UTC
The problematic place is winmtf.cxx::1648, and I'm currently unsure
about how to tackle this problem. Generally speaking, appearance of
raster ops in GDI metafiles _cannot_ be avoided with the existing
architecture, except one renders large parts of an imported WMF/EMF
into a bitmap of predetermined size (_not_ an option, since WMF/EMF
should remain resolution-independent).
Thus, to address this problem once and for all, one would have to
emulate raster ops during printing/PDF output, generating bitmaps
there (at least for printing, one knows the target resolution in
advance). PDF output at least has a predetermined 'target audience'
(screen, print, or publishing), which also implies a resolution.
But that is a major endeavour, I'm unwilling to take for 1.1.1. Maybe
I can come up with a symptomatic fix for the described case, getting
back to that next week latest.
Comment 9 thb 2003-12-04 19:00:31 UTC
Okay, I think I've got it. The pattern issue is a decoy, regardless of
pattern support emulated or not, the result is the same. The crucial
point here is that OutputDevice does not support an OR raster
operation. This has to be emulated by an XOR followed by an explicit
'everywhere where source has one-bits, also set target one bit' step
(a and not b or not a and b or a and b). This XOR now is a no-op both
on printer and during pdf export, and just paints the bitmap as-is,
which happens to be black outside the chain symbol.

Problem is, it's unavoidable to do it like this, since in general, I
don't know what's behind the bitmap. 

Although, in this special case, there's a sequence of two bitmaps
painted, of exactly the same size at the same output position. The
ROPs are SRCAND followed by SRCPAINT, which, incidentally, is exactly
swapped order of a case already handled. Thus, I can interpret the
first bitmap as a mask, and the second as the image, compose both into
a BitmapEx, and am done with this problem.
Comment 10 thb 2004-01-08 11:29:32 UTC
Please verify the fix.
Comment 11 christian.guenther 2004-01-08 17:18:48 UTC
change the resolution to fixed.
Comment 12 christian.guenther 2004-01-08 17:19:35 UTC
CGU: Verified in cws draw23 on Sols, Lin, Win.
Comment 13 christian.guenther 2004-01-28 14:03:59 UTC
The fix is integrated in OOo1.1.1 on Sols, Lin, Win.
This version will be available soon.
Comment 14 groucho266 2004-01-30 13:35:10 UTC
Reopened to integrate fix into SRC680 MWS.
Comment 15 groucho266 2004-01-30 13:58:35 UTC
Reassigned to person who fixed this bug.
Comment 16 pavel 2004-02-06 21:07:06 UTC
As this is fixed for 1.1.1, can we change the target to 2.0 now?
Comment 17 thb 2004-02-10 12:16:48 UTC
THB->CGU: Also fixed in SRC680 draw23master, please verify.
Comment 18 thb 2004-02-10 12:17:49 UTC
Reassigned
Comment 19 christian.guenther 2004-02-11 15:03:00 UTC
CGU: Cloned the task for integration in OOo2.0
Id of the cloned task is issue 25374
I close the issue
Comment 20 christian.guenther 2004-02-11 15:03:53 UTC
verified in OOo1.1.1
Comment 21 christian.guenther 2004-02-11 15:04:16 UTC
I close the issue.
Comment 22 christian.guenther 2004-02-12 09:05:01 UTC
I reope nthe issue to test the integration in OOo2.0
Comment 23 christian.guenther 2004-02-12 09:05:45 UTC
change the resolution to fixed.
Comment 24 christian.guenther 2004-02-12 09:09:40 UTC
target OOo 2.0
Comment 25 christian.guenther 2004-02-12 11:35:23 UTC
This issue is duplicated for integration in OOo 2.0
Therefore I set the target back to OOo 1.1.1 and change the resolution to Verified.

Comment 26 christian.guenther 2004-02-12 11:35:53 UTC
I close this issue