minor EMF import issues

Bug #1242927 reported by David Mathog
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
David Mathog

Bug Description

This patch fixes 3 minor EMF import issues:

1. bitblt of an area, no image src, with ROP patinvert was drawing black, should be inverse of the defined pattern color.
2. bitblt of an area, no image src, with ROP patcopy was drawing white, should be the defined pattern color
3. encountered an EMF file where the initial moveto in a path preceded the beginpath record. Treat this as if the moveto followed the beginpath record. (Paths still must begin with a moveto, patch just allows a little more leeway in where that may be placed.)

Note that 1 and 2 do not address the more general issue that EMF bitblt and other ROP type operators are image based, not object based. This patch just handles better a couple of cases where something reasonable can be done with the input.

Tested with r12704 in trunk.

Tags: emf importing
Revision history for this message
David Mathog (mathog) wrote :
jazzynico (jazzynico)
tags: added: emf importing
Changed in inkscape:
assignee: nobody → David Mathog (mathog)
status: New → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

@David - It's a bit difficult for a bug tester (not necessarily EMF expert) to figure out the issue. It would be very helpful if you could provide an EMF test file so that we can reproduce the bug and test your fix.
Anyway, thanks for the patch!

Revision history for this message
David Mathog (mathog) wrote :
Revision history for this message
David Mathog (mathog) wrote :

This is the before (upper) and after (lower) output.

Originally the small path object at upper left was not drawn, and the bitblt's using ROPs PATINVERT and PATCOPY (left and right squares) were drawn incorrectly, as black and white.

Revised version draws the small path, and the bitblt's using ROP PATINVERT is the inverse color of the specified pattern, while ROP PATCOPY is the color of the specified pattern.

Square in the middle uses ROP PATPAINT, and that was and is still correct.

Additional testing, look for any differences in test_libuemf_ref.emf from libUEMF distribution (at sourceforge). This patch should not change anything in the display of that (complex) EMF file.

Revision history for this message
David Mathog (mathog) wrote :

Note, this patch consists of the patches for bug #1221454 and #1060141.

(Sorry, I forgot that I had already posted the patches under those bug numbers.)

Revision history for this message
su_v (suv-lp) wrote :

Individual patches from bug #1221454 and bug #1060141 tested successfully with r12715 on OS X 10.7.5 using the test files from those reports.

Same result with the patch from this report (applied after having reverted the other two patches): fix confirmed for all three test cases (including the test file from this report).

Revision history for this message
su_v (suv-lp) wrote :

Fix committed in r12721 - thx for the patch!

Changed in inkscape:
importance: Undecided → Medium
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.