FileMetadataStripping

FileMetadataStripping (ODC)

Stable version 0.1.5 (Compatible with ODC)
Uploaded on 30 Jul by Alexandre Realinho
FileMetadataStripping

FileMetadataStripping (ODC)

Documentation
0.1.5

ADDING THE LIBRARY TO YOUR APP
-------------------------------

1. Open your ODC app or library in ODC Studio.
2. Click the Dependencies icon (puzzle piece) in the toolbar.
3. Search for FileMetadataStripping and select it.
4. Tick StripFileMetadata and the FileMetadataResult structure, then click Apply.

No further configuration is required.


USAGE
-----

Call StripFileMetadata at the earliest point in any flow that accepts a file upload, before the file is forwarded to an AI API, stored, or processed further.

Input parameters
----------------

RawFile (Binary Data) - the uploaded file in any supported format. Pass the Content field from a File Upload widget or a binary variable you have already loaded.

StripBodyAuthors (Boolean) - optional, default False. Set to True to also blank author names from tracked changes and comments inside OOXML and Word 2003 XML document bodies (w:author / w:initials, aml:author, XLSX comment authors, PPTX comment-author name / initials, and the Excel 365 threaded-comment person records). Leave False to strip only core, application, and custom properties.

Output - FileMetadataResult structure
--------------------------------------

CleanFile (Binary Data) - the file with all embedded metadata removed. Use this in place of the original when calling AI APIs or saving to storage.

ExtractedMetadata (Text) - JSON string of every metadata entry that was found and removed. Returns "[]" when no metadata was found. Use this for audit logging or security review.

RemovedEntryCount (Integer) - total number of metadata entries removed.

IsPassthrough (Boolean) - True when the file format has no supported metadata containers (e.g. TXT, CSV, JSON, XML, HTML, BMP). CleanFile is the unchanged input.

Recommended pattern in a Server Action
---------------------------------------

1. Receive the uploaded file as a Binary Data input parameter.
2. Call StripFileMetadata passing the binary as RawFile.
3. Use StripFileMetadata.CleanFile for all downstream calls (AI API, file storage, database).
4. If StripFileMetadata.RemovedEntryCount > 0, write StripFileMetadata.ExtractedMetadata to your audit log.
5. Optionally record IsPassthrough in the audit entry to separate passthrough files from clean processed files.


SUPPORTED FILE FORMATS
-----------------------

Every format below has an explicit xUnit test in the component's test project. Format detection is automatic and based on magic bytes.

IMAGES

Standard raster (JPEG, PNG, GIF, TIFF, WebP) - strips EXIF, IPTC, XMP, ICC profiles, and comments. Animated GIF / WebP and multi-frame TIFF are supported: metadata stripped from every frame, all frames preserved.

AVIF - fully supported round-trip.

HEIC / HEIF (mif1 / msf1 brands) - metadata stripped; output transcoded to JPEG because the x265 HEVC encoder is GPL-licensed and cannot be bundled. transcodedFormat key set.

APNG - all animation frames decoded and stripped. Writing APNG requires ImageMagick's video delegate (ffmpeg); without it the output is transcoded to JPEG.

RAW camera (ARW, CR2, DNG, NEF, ORF, PEF, RAF, X3F) - EXIF, XMP, ICC profiles removed via the underlying TIFF structure.

Modern / HDR (JXL, JP2, JXR / WDP, Ultra HDR, OpenEXR, Radiance HDR .hdr, QOI) - EXIF, XMP, ICC profiles, and encoder comments removed. Radiance HDR encoder-injected "# Created by ImageMagick" lines are stripped; the #?RADIANCE identification line is preserved. JPT (JPEG 2000 raw code stream) is decode-only and returned unchanged with a processingError note.

Legacy raster (PSD / PSB, TGA, DDS, PCX / DCX, SGI, SUN, PICT, PCD / PCDS, FITS, JBIG, WMF, ICO, XCF, Netpbm) - format-specific comments and profiles removed where present. XCF is transcoded to JPEG on write.

Film formats (DPX, CIN) - image profiles stripped plus per-image dpx:* / cin:* production attributes (film title, origination device, source filename, frame position). Values recorded under the dpx and cin keys.

Medical imaging (DICOM .dcm) - detected via 128-byte preamble + DICM signature; output transcoded to JPEG. DICOM tag parsing is out of scope; PHI tags in the DICOM header survive.

Multi-image containers (MPO, MNG) - every frame stripped and preserved.


DOCUMENTS

PDF - strips Title, Author, Subject, Keywords, Creator, Producer, the catalog XMP metadata stream, and the /Author entry from every comment, sticky-note, and markup annotation. Distinct annotation author names recorded under annotationAuthors.

RTF - detected via {\rtf1. Blanks every string-bearing control word inside \info (author, title, subject, keywords, comment, operator, company, doccomm, category, hlinkbase, manager). Numeric control words preserved. Values recorded under the control-word name.

Office Open XML (DOCX, DOTX, DOCM, DOTM, XLSX, XLTX, XLSM, XLTM, PPTX, POTX, PPSX, PPTM, POTM, PPSM) - always strips core properties (Creator, LastModifiedBy, Created, Modified, Title, Subject, Description, Keywords, Category, Revision, LastPrinted, Identifier, Version), application properties (Application, Company, Manager, AppVersion, Template, HyperlinkBase), all custom properties, and the embedded page-preview thumbnail (docProps/thumbnail.*) along with its _rels/.rels relationship - preventing a rendered preview from reaching a vision model. When StripBodyAuthors = True, also blanks tracked-change and comment authors across DOCX / XLSX / PPTX and the Excel 365 threaded-comment person records. Values recorded under app* keys, customProperties, and strippedAuthors.

Legacy binary Office / CFBF (DOC, DOT, XLS, XLT, PPT, POT, PPS) - detected via the 8-byte magic D0 CF 11 E0 A1 B1 1A E1 checked before the ZIP signature. Deletes both OLE property-set streams: SummaryInformation (Title, Subject, Author, Keywords, Comments, Template, Last-Saved-By, Application) and DocumentSummaryInformation (Category, Manager, Company, ContentStatus, Language, user-defined properties). Freed sectors are dropped from the output so raw values do not survive in unallocated space. Values recorded under summaryInformation, documentSummaryInformation, and customProperties.

ODF (ODT, ODS, ODP, OTT, OTS, OTP, ODG, OTG, ODC, ODF, ODB, ODI) - strips dc:creator, dc:title, dc:description, dc:subject, meta:initial-creator, meta:generator, meta:editing-cycles, meta:editing-duration, and all meta:user-defined properties. Templates, drawings, charts, formulas, databases, and images all match the application/vnd.oasis.opendocument.* mimetype prefix and share the ODT / ODS / ODP strip path.

Flat ODF (FODT, FODS, FODP) - single-file XML variant, detected by the