OptionalkeepOptionalmode'all' removes every metadata carrier (EXIF, XMP, textual chunks, comments; ICC too unless keepIcc). 'gps-only' rebuilds the EXIF block without the GPS IFD — every other tag survives, but a JPEG thumbnail IFD is dropped by the rebuild (documented trade-off).
With mode 'all': keep the ICC colour profile (default false).