Announcement

#1 2021-01-27 14:45:20

mountwilson
Member
Zwischen den Meeren
2017-07-10
21

Read Meta Data for pwg_representatives

Hello!

I'm currently trialing pwg_representatives for some .nef raw files.

Sample  list of files:
galleries/folder/myfile.nef
galleries/folder/myfile.xmp
galleries/folder/pwg_representative/myfile.jpg

The thumbnails and image are fine, but the metadata is ignored.
I copied the meta data from the .xmp into the .jpg w/o luck.

The plugin "read metadata" event throws an exception.

".../admin.php?page=plugin-read_metadata&showmetadata=1165" returns

Fatal error: Uncaught exception 'ImagickException' with message 'UnableToOpenBlob `/tmp/magick-XXDOeGST.ppm': @ error/blob.c/OpenBlob/2491' in .../plugins/read_metadata/admin.php:189 Stack trace: #0 .../plugins/read_metadata/admin.php(189): Imagick->__construct('./galleries/raw...') #1 .../admin/plugin.php(53): include_once('/share/...') #2 .../admin.php(298): include('/share/...') #3 {main} thrown in .../plugins/read_metadata/admin.php on line 189

Maybe read_metadata tries to read it from the .nef.

Where does Piwigo expect the meta data, .xmp or .jpg?
Does it support .xmp files at all?

piwigo: 11.1.0
read_metadata : revision 11.0.a
IMagick:  6.6.1-5 / 6.8.9  (two different installations)

These installations are both not public.


Thanks for reading and stay healthy, mountwilson

Offline

 

#2 2021-01-27 15:31:02

erAck
Only trying to help
2015-09-06
1504

Re: Read Meta Data for pwg_representatives

XMP sidecar files are not supported. Embedded XMP isn't supported either, apart from a small tags importing plugin you could manually add, [Forum, topic 25709] Plugin to import XMP tags as Piwigo keywords


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2021-01-27 18:22:50

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7067

Re: Read Meta Data for pwg_representatives

Hi :-)

read_metadata read meta data in file jpeg


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#4 2021-01-27 20:04:29

erAck
Only trying to help
2015-09-06
1504

Re: Read Meta Data for pwg_representatives

So that's [extension by ddtddt] Read Metadata.
Unclear from the description (would be nice to add that there), but from the source code comments it seems to read some EXIF, IPTC and XMP metadata; for the latter it requires the ImageMagick PHP extension.


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2021-01-28 02:13:00

executive
Member
2017-08-16
1099

Re: Read Meta Data for pwg_representatives

can you provide a JPG for us to look at?

Offline

 

#6 2021-01-28 06:23:44

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7067

Re: Read Meta Data for pwg_representatives

Hi :-)

executive wrote:

can you provide a JPG for us to look at?

+1


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2021-01-28 13:55:17

mountwilson
Member
Zwischen den Meeren
2017-07-10
21

Re: Read Meta Data for pwg_representatives

Hi!

Thank's a lot for your attention!

As a quick test I've made a an ugly change to "...\plugins\read_metadata\admin.php":

Code:

      
  //  Check ImageMagick is installed
  if  (  extension_loaded(  'imagick' ) &&
      class_exists(    'imagick' )) { 
    
echo $filename;    

    //create new Imagick object from image & get the XMP data
    $RM_IM =      new imagick($filename) ;

This gives:

.galleries/folder/myfile.nef
Fatal error: Uncaught exception 'ImagickException' with message
...

This replacement does the job:

Code:

    //create new Imagick object from image & get the XMP data;
    $pinfo = pathinfo($filename);
    $repname = $pinfo['dirname'] . DIRECTORY_SEPARATOR.'pwg_representative' .DIRECTORY_SEPARATOR. $pinfo['filename'] .'.jpg';

    $file = $filename;
    if (file_exists($repname)) {
      $file = $repname;
    }

    try {
      $RM_IM =  new imagick($file);
        ...

But I'm sure that there's a much better way as it ignores representative_ext.

Thank's again for reading, mountwilson

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact