Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 4526 to 4552

Definition

 
function stripMetadata($file_path)
    {
    
debug_function_call('stripMetadata'func_get_args());
    
$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 18th May 2024 21:35 Europe/London time based on the source file dated 17th May 2024 18:10 Europe/London time.