Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 4563 to 4589

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 17th November 2024 15:35 Europe/London time based on the source file dated 15th November 2024 18:30 Europe/London time.