pdf-association / pdf-issues

Industry-based resolutions for issues and errata reported against any PDF-related specification
https://pdf-issues.pdfa.org/
66 stars 2 forks source link

SMaskInData overrides Mask - but it's not clearly stated #215

Open lrosenthol opened 2 years ago

lrosenthol commented 2 years ago

In Table 87 (Additional Entries in Image Dictionary), for the SMask entry, it reads:

If present, this entry shall override the current soft mask in the graphics state, as well as the image’s Mask entry, if any. However, the other transparency-related graphics state parameters — blend mode and alpha constant — shall remain in effect.

However, neither statement is duplicated in the SMaskInData entry.

It is, however stated later on in 11.6.4.3, bullet three

If SMaskInData is present with a value other than 0, the embedded soft-mask shall override any explicit or colour key mask specified by the image dictionary’s Mask entry, and it shall override, for this image object only, the current soft mask in the graphics state.

Apparently some implementations (e.g. Chrome) didn't read far enough and apply both Mask and SMaskInData.

Recommend that we copy the text from the SMask entry into the SMaskInData entry for consistency.

petervwyatt commented 2 years ago

This may already have been covered somewhat by Errata #13 which we resolved as https://pdf-issues.pdfa.org/32000-2-2020/clause08.html#Table87.

lrosenthol commented 2 years ago

@petervwyatt that errata is good, but doesn't cover this particular item since the piece of relevant text is in a different section than the one addressed in the errata.

petervwyatt commented 2 years ago

Finally getting back around to errata... I'm also seeing a few other related issues

there are differences here between "shall have no associated soft mask" and "shall be ignored"/"shall be used" - is it allowed to have a soft mask in the data which must then subsequently be ignored or not??



The notes for SMask and SMaskInData stating "NOTE Interactions between SMask, SMaskInData and the current soft mask in the graphics state are set out in clause 11.6.4.3, "Mask shape and opacity". should also explicitly reference the Mask key to tie everything together. And this same note should also be added to the Mask entry in Table 87 since clause 11.6.4.3 discusses Mask...


To @lrosenthol original suggestion, add the following text from Table 87 SMask to the Table 87 SMaskInData entry for the value 0 (since that is the only time SMask is allowed when SMaskInData is also present):

"If present, SMask shall override the current soft mask in the graphics state, as well as the image’s Mask entry, if any. However, the other transparency-related graphics state parameters — blend mode and alpha constant — shall remain in effect."

petervwyatt commented 2 years ago

PDF TWG want all precise wording changes listed out.

petervwyatt commented 12 months ago

Circling back around to try and get consensus: where do people stand between file format requirements ("shall not be present") vs processor requirements ("shall be ignored" / "shall be used")? Or is this case-by-case? Or even both (which is slightly confusing, but that does result in a deterministic rendering appearance under all conditions!)?

I personally think file format requirements are preferred since these can always be validated ("shall not be present") AND we should add a matching processor requirement for important rendering aspects "However if present, it shall be ignored".

DietrichSeggern commented 6 months ago

I agree with all that has been said here. We should copy the para from SMask to SMaskInData and add an additional statement to SMaskInData that if SMask is also present it shall be ignored (maybe this should be a recommendation only since it shall not be present altogether).

petervwyatt commented 6 months ago

PDF TWG agree to both file format and backup processor requirement.

petervwyatt commented 2 months ago

Trying to pull all proposed changes (italicised text below) together in a single place covering both file format and processing requirements (in the event of keys being present when they shouldn't be so as to ensure consistent appearance):

petervwyatt commented 2 months ago

PDF TWG agree