GetImageDeduplicationReportJSON

Image handling, optimisation, diagnostics

Description

Builds a read-only manifest of byte-identical image XObjects that can be consolidated by DeduplicateResources

The manifest groups images by a SHA-256 digest over the canonical image dictionary and encoded payload, records every indirect object and generation number, reports the pages that reach each image through nested Form XObjects, and estimates reclaimable encoded payload bytes

Syntax

Delphi

Function TPDFlib.GetImageDeduplicationReportJSON(Out Report: WideString): Integer;

DLL

const wchar_t* DLGetImageDeduplicationReportJSON(int InstanceID);

ActiveX

Function PDFlib::GetImageDeduplicationReportJSON() As String

Return values

The Delphi method returns the number of duplicate groups and writes the JSON document to Report

The DLL and ActiveX methods return the JSON document directly

JSON fields

candidateImagesNumber of indirect image streams hashed during the dry run
duplicateImagesNumber of image objects that can be repointed to a canonical object
groupCountNumber of duplicate groups
crossPageGroupCountGroups used by more than one page
reclaimableBytesTotal duplicate encoded payload bytes
groupsDigest, payload size, cross-page state, and member objects with one-based page arrays

Remarks

The scan never rewrites references or removes objects

Dictionary key order and indirect /Length storage do not create false differences, while decoding parameters, colour spaces, masks, interpolation, and other semantic dictionary differences remain distinct

See also

DeduplicateResources, FindImages, GetImageInfoJSON