Use GroupDocs.Redaction in your Python via .NET project to clean document metadata in just a few steps.
- Set up a Redactor and open your Photo file.
- Pick which metadata fields to delete.
- Apply redaction to clean the file.
- Save the final version.
Use GroupDocs.Redaction in your Python via .NET project to clean document metadata in just a few steps.
import groupdocs.redaction as gr
import groupdocs.redaction.redactions as grr
# Erase metadata in PHOTO documents
# Choose which metadata to redact
redaction = grr.EraseMetadataRedaction(grr.MetadataFilters.ALL)
# Use Redactor to open your file
with gr.Redactor("input.jpeg") as redactor:
# Run and save
result = redactor.apply(redaction)
redactor.save()
GroupDocs.Redaction for Python via .NET helps remove data that shouldn’t be seen. Delete text, images, and hidden details in just a few clicks.
Find and delete sensitive words, numbers, or patterns.
Cover parts of images that hold private data.
Delete file details like Author, Title, or Comments.
import groupdocs.redaction as gr
import groupdocs.redaction.options as gro
import groupdocs.redaction.redactions as grr
import groupdocs.pydrawing as grd
# Target the Author field
redaction_author = grr.MetadataSearchRedaction("[A-Za-z0-9 ]+", "GroupDocs Company")
redaction_author.filter = grr.MetadataFilters.AUTHOR
# Target the Title field
redaction_title = grr.MetadataSearchRedaction(@"[A-Za-z0-9 ]+", "GroupDocs.Redaction Usage")
redaction_title.filter = grr.MetadataFilters.TITLE
# Load the file into the redactor
with gr.Redactor("source.jpeg") as redactor:
# Redact selected metadata
redactions = [
redaction_author,
redaction_title
]
result = redactor.apply(redactions)
# Save the updated file
save_options = gro.SaveOptions()
save_options.add_suffix = True
save_options.rasterize_to_pdf = False
result_path = redactor.save(save_options)
Download GroupDocs.Redaction for free or get a trial license for full access!
Explore documentation, code samples, and community support to enhance your experience.
Use Python to clear hidden metadata from PHOTO files. Keep documents clean and secure.