Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video 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 3868 to 3893

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 26th November 2020 04:35 Europe/London time based on the source file dated 13th November 2020 16:50 Europe/London time.