Ignore:
Timestamp:
Jan 17, 2021, 10:00:06 PM (3 years ago)
Author:
ddtddt
Message:

[read_metadata] add XMP support thanks to executive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/read_metadata/admin.php

    r32108 r32397  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Read Metadata                                                         |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2016-2017 ddtddt               http://temmii.com/piwigo/ |
     3// | Read Metadata plugin for piwigo  by TEMMII                            |
     4// +-----------------------------------------------------------------------+
     5// | Copyright(C) 2016-2021 ddtddt               http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    176176                  'RM_EXIFWORDING' => 'EXIF Fields in ',
    177177          ));
     178         
     179        #
     180        #       Read and parse XMP metadata
     181        #       (ImageMagick PHP extension required)
     182        #
     183
     184        //      Check ImageMagick is installed
     185        if      (       extension_loaded(       'imagick' ) &&
     186                        class_exists(           'imagick' )) {
     187
     188                //create new Imagick object from image & get the XMP data
     189                $RM_IM =                        new imagick($filename) ;               
     190                $RM_XMP =                       $RM_IM -> getImageProperties( "xmp:*" ) ;
     191
     192                // Setup readout
     193                $headerTxt = 'XMP Properties:' ;
     194                $template -> assign('XMPdata', $RM_XMP) ;
     195        }
     196        else {
     197                $headerTxt = l10n('Unable to read XMP data. ImageMagick not loaded.') ;
     198        }
     199
     200        $template ->    assign('XMPheader', $headerTxt ) ;
     201
    178202
    179203       
Note: See TracChangeset for help on using the changeset viewer.