Skip to main content

CodecNotes

Struct CodecNotes 

Source
#[non_exhaustive]
pub struct CodecNotes { pub geometry_mismatch: bool, pub cmyk_image: bool, pub cmyk_polarity_unverifiable: bool, pub jpx_smask_in_data_preblended: bool, pub jpx_palette_left_to_pdf: bool, pub jxl_nonstandard: bool, pub lzw_framing_anomalies: usize, }
Expand description

Per-image honesty counters produced by the codec layer (decision 005 §6.4; the same disclosure discipline as rule R20).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§geometry_mismatch: bool

The codestream’s geometry disagreed with the image dictionary (/Width, /Height, /BitsPerComponent, or the component count implied by /ColorSpace). For JPX the codestream wins by Table 89; for DCT a mismatch is a producer bug. Counted either way, never silent.

§cmyk_image: bool

This is a 4-component DCT image whose effective ColorTransform is 1 or 2 (YCCK/YUVK storage) — the benign census half of decision 006 §4.4’s split. The mandated YCCK→CMYK inverse ran (TN #5116 §13.1; it recovers true ink directly), the samples carry no residual polarity ambiguity, and pdfcer’s output pixel-matches pdfium on every such file in the corpus (9 as of 2026-07-31 — the earlier “zero exist” claim here was wrong twice over; see 005’s addenda). A pure volume counter: no warning is warranted (rule R30 covers the shape that does warrant one, below).

§cmyk_polarity_unverifiable: bool

This is a 4-component DCT image with effective ColorTransform 0 (raw CMYK storage) and no /Decode array — the one shape where the undocumented Photoshop inverted-storage convention can still produce a photographic negative, because neither the codestream nor the dictionary disambiguates the polarity (decision 006 §5.3/§5.4, rule R30). Reported, never repaired: all four reference engines render this shape un-inverted and share the gap; pdfcer’s differentiator is that it names it. Zero exist in the conformance corpus (the 9 four-component files are all transform 2).

§jpx_smask_in_data_preblended: bool

This JPX image’s /SMaskInData is 2: Table 89’s “the image’s data stream includes colour channels that have been preblended with a background; the image data also includes an opacity channel”, for which a reader “may create a soft-mask image with a Matte entry”.

Recognized and deferred, never approximated (see jpx). The colour samples are returned exactly as stored — i.e. already composited over that backdrop, which is a recognizable picture rather than a grey box — and the opacity channel is not exposed, because using it without un-premultiplying would double-darken every partially transparent pixel. Un-premultiplying needs the Matte backdrop colour and clause 11’s transparency model, which decision 005 §7 assigns to ROADMAP.md Pass 1.1 item 6.3.

§jpx_palette_left_to_pdf: bool

A JP2 palette was left unresolved because the image dictionary carries its own /Indexed colour space (§8.9 Table 89).

§Why this is worth a field rather than being silent

Two lookup tables describe the same image — the codestream’s pclr/cmap boxes and the PDF’s /Indexed array — and exactly one of them may be applied. Applying both maps a colour value through a palette a second time and paints whatever entry that index happens to hit, or black when it hits nothing.

So this records which authority won, and it is not a shortfall: Table 89 makes the dictionary’s space the answer whenever it is present. It is disclosed because the decision is invisible in the output — a correct render and a double-resolved one are both just coloured pixels, and the difference only shows up as the wrong colour, which nothing downstream can detect.

§jxl_nonstandard: bool

The image used the non-standard /JXLDecode filter (JPEG XL). It decoded, but a conforming PDF reader need not display it, so the shells disclose it; preflight flags it.

§lzw_framing_anomalies: usize

LZW framing anomalies seen in the byte-stream prefix of the chain (see FilterNotes::lzw_framing_anomalies).

Trait Implementations§

Source§

impl Clone for CodecNotes

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CodecNotes

Source§

impl Debug for CodecNotes

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CodecNotes

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for CodecNotes

Source§

impl PartialEq for CodecNotes

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CodecNotes

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, Ctx> BundleDefault<Ctx> for T
where T: Default,

Source§

fn default_with_context(_: Ctx) -> T

Creates a default value with the given context.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more