Bug 694794 - pdf_dev_new_form to store the blendmode in an ExtGStates.
Summary: pdf_dev_new_form to store the blendmode in an ExtGStates.
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-19 15:54 UTC by Michaël Cadilhac
Modified: 2013-12-24 02:22 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
Proposed fix (1.77 KB, patch)
2013-11-19 15:54 UTC, Michaël Cadilhac
Details | Diff
Proposed fix (1.46 KB, patch)
2013-11-19 16:21 UTC, Michaël Cadilhac
Details | Diff
0001-Bug-694794-Fix-blendmode-use-in-pdf-device.patch (4.27 KB, application/octet-stream)
2013-12-23 07:57 UTC, Robin Watts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michaël Cadilhac 2013-11-19 15:54:02 UTC
Created attachment 10413 [details]
Proposed fix

pdf_dev_new_form stores the blendmode directly in the group dict:

pdf_dict_puts_drop(group, "BM", pdf_new_name(doc, fz_blendmode_name(blendmode)));

Transparency groups do not have a BM field, which only appears in ExtGStates.
Comment 1 Michaël Cadilhac 2013-11-19 16:19:56 UTC
Ok, my fix proposal is rotten.  So basically: I should not have used num_smask.  That's plain wrong.  Second, I do not track previously created ExtGStates with the given BM, so we'd be better off just inlining the ExtGState.  Here is a new, shorter and cleaner proposal.
Comment 2 Michaël Cadilhac 2013-11-19 16:21:11 UTC
Created attachment 10414 [details]
Proposed fix
Comment 3 Robin Watts 2013-12-23 07:57:40 UTC
Created attachment 10500 [details]
0001-Bug-694794-Fix-blendmode-use-in-pdf-device.patch

Proposed fix.
Comment 4 Robin Watts 2013-12-24 02:22:43 UTC
Fixed in:

commit 9bc4493099ae2e4264445ac9f8465e8876b8724a
Author: Robin Watts <robin.watts@artifex.com>
Date:   Mon Dec 23 15:50:57 2013 +0000

    Bug 694794: Fix blendmode use in pdf device.

    Previously we were setting blendmode in the created form XObjects
    transparency group definition. This didn't work as PDF readers don't
    look for it there.

    Now we set it in the calling stream's resources, and set it before
    calling the group.

Thanks for the report!