Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

stripMetadata()

Description

Strips metadata from file


command returned instead of running the command on the file

Parameters

ColumnTypeDefaultDescription
$file_path string Physical path to file that will have metadata stripped. Use NULL to just get the exiftool

Return

boolean|string Returns TRUE or the Exiftool command for stripping metadata

Location

include/resource_functions.php lines 3523 to 3548

Definition

 
function stripMetadata($file_path)
    {
    
$exiftool_fullpath get_utility_path('exiftool');

    if(
$exiftool_fullpath === false)
        {
        
trigger_error('stripMetadata function requires Exiftool utility!');
        }

    
$command "{$exiftool_fullpath} -m -overwrite_original -E -gps:all= -EXIF:all= -XMP:all= -IPTC:all=";

    if(
is_null($file_path))
        {
        return 
$command;
        }

    if(!
file_exists($file_path) || !is_writable($file_path))
        {
        return 
false;
        }

    
$file_path escapeshellarg($file_path);
    
run_command("{$command} {$file_path}");

    return 
true;
    }

This article was last updated 12th July 2020 01:35 Europe/London time based on the source file dated 10th July 2020 16:06 Europe/London time.