Hello,
Problem with EXIF Metadata
I installed a fresh and compleet new testserver for working with Piwigo.
But i have problems with reading the EXIF Metadata.
==> Remark i know that IPTC data can be used but that's not the point :-)
For some reason Piwigo shows most of the EXIF data as ????????????? while Metadata2Go.com, Microsoft and exiftools shows the correct data.
Can someone help me pls.
==> REMARK, everytime i test a new version or installation of Piwigo i deleted al the tables in the mysql server database and deleted and replaced al the files from Piwigo folder to prevent crossover errors.
only the conf of NGINX rest the same.
Environment details
//-----------------------------------------------------------------------------------------------------------------------
- Debian GNU/Linux 12 (bookworm)
- php/8.2 PHP Modules installed bcmath calendar curl date exif imagick json mbstring memcached xml xmlreader xmlrpc xmlwriter (REMARK List NOT complete for easier reading)
- NGINX
- mysql Ver 15.1 Distrib 10.11.6-MariaDB
Piwigo 14.2.0 Upgradecontrole
Geïnstalleerd op 15 februari 2024, 5 dagen geleden
Besturingssysteem: Linux
PHP: 8.2.7 (Toon info) [2024-02-20 19:28:45]
MySQL: 10.11.6-MariaDB-0+deb12u1 [2024-02-20 19:28:45]
Afbeeldingen-bibliotheek: ImageMagick 6.9.11-60
Cache grootte Niet beschikbaar nooit berekend Ververs
Geactiveerde plug-in lijst
AlwaysShowMetadata
Exif View
Grum Plugins Classes.3
LocalFiles Editor
Read Metadata
Tag To Keyword
//=======================================================================================================================
==>I tried different configs to see the different outputs
example with 'Keywords' or with 'XPKeywords' and so on ... (whatever i found on goolge about Piwigo and metadata)
==> content of my current local/config/config.inc.php
//-----------------------------------------------------------------------------------------------------------------------
<?php
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-+_.,; ‘!@#$%^()\[\]ÀÁÂÃÄÅąāàáâãäåæßẞÇçćÈÉÊËèéêëĞğÌÍÎÏİıìíîïŁÑñńöÖÒÓÔÕÖØòóôõöøŞŠşÙÚÛÜùúûüÿ]+$/u';
// for some file types, Piwigo will try to generate a pwg_representative TIFF, videos, PDF)
$conf['upload_form_all_types'] = true;
// $conf['enable_i_log'] = true;
// $conf['menubar_tag_cloud_content'] = 'current_only';
$conf['use_exif'] = true;
$conf['use_exif_mapping'] = array(
'tags' => 'Keywords',
// 'tags' => 'XPKeywords',
'date_creation' => 'DateTimeOriginal',
'comments' => 'XPComment',
'title' => 'XPSubject',
'subject' => 'XPSubject',
'author' => 'Artist'
);
$conf['show_exif'] = true;
$conf['show_exif_fields'] = array(
// 'XPKeywords',
'Keywords',
'DateTimeOriginal',
'Artist',
'Copyright',
'Comment'
);
?>
//-----------------------------------------------------------------------------------------------------------------------
==> Test Piwigo
==> After pressing syncronisation button with Simulatie
[Simulatie] Zoek naar nieuwe foto's in de mappen
3 Albums toegevoegd aan de database
7 Foto's toegevoegd aan de database
0 Albums uit de database verwijderd
0 Foto's verwijderd uit de database
0 Foto's bijgewerkt in de database
0 Fouten tijdens de synchronisatie
[Simulatie] Metadata synchronisatie-resultaten
0 Foto-informatie gesynchroniseerd met bestandsmetadata
0 Foto's waarvan de metadata gesynchroniseerd zou kunnen worden
Gebruikte metadata : filesize, width, height, tags, keywords, date_creation, comment, latitude, longitude
==> After pressing syncronisation button without Simulatie
Metadata synchronisatie-resultaten
9 Foto-informatie gesynchroniseerd met bestandsmetadata
9 Foto's waarvan de metadata gesynchroniseerd zou kunnen worden
Gebruikte metadata : filesize, width, height, tags, date_creation, comments, title, subject, author, latitude, longitude
//=====================================================================================================================
RESULTS INTO DATABASE
'Keywords' ===> ??? imported into database
'XPKeywords' ===> NO IMPORT into database
Data imported into sql database (piwigo_tags)
|_. id |_. name |_. url_name |_. lastmodified |
| 3 | ?????????????????? | ?????????????????? | 2024-02-20 14:31:54 |
| 2 | ??????????????????????????????????????????? | ??????????????????????????????????????????? | 2024-02-20 14:31:54 |
| 4 | ????????????????????????????????????????????? | ????????????????????????????????????????????? | 2024-02-20 14:31:54 |
===> REMARK FROM MYSELF No sign found of importing comments, title, subject, author into database
//-----------------------------------------------------------------------------------------------------------------------
==> Getting a sample of metadata “sample.jpg” into to <rootfolder>/tools/sample.jpg with metadata.php (shorted for realibility)
Informations are read from sample.jpg
IPTC Fields in sample.jpg
2#005 = IPTC ObjectName 2024-01-01 (FileName)
2#025 = XPkeyword1,keyword2,keyword3,mam,being mother
2#055 = 20220814
2#060 = 100102+0200
2#062 = 20220814
2#063 = 100102+0200
2#080 = IPTC By-Line Artist
2#116 = IPTC CopyRightNotice
2#120 = IPTC Caption-abstract 2024-01-01 (FileName)
EXIF Fields in sample.jpg
Array
(
[FileName] => sample.jpg
[FileDateTime] => 1708440201
[FileSize] => 135428
[FileType] => 2
[MimeType] => image/jpeg
[SectionsFound] => ANY_TAG, IFD0, EXIF, WINXP
[COMPUTED] => Array
(
[html] => width="880" height="513"
[Height] => 513
[Width] => 880
[IsColor] => 1
[ByteOrderMotorola] => 1
[Copyright] => XP Copyright (sample.jpg)
)
[ImageDescription] => XP Title 2024-01-01 (FileName)
[Software] => Software Exiftool 12.70
(sample.jpg)
[Artist] => XP Artist (sample.jpg)
[Copyright] => XP Copyright (sample.jpg)
[Exif_IFD_Pointer] => 534
[Title] => ???????????????????????????????
[Comments] => ??????????????????????
[Author] => ??????????????????????
[Keywords] => ?????????????????????????????????????????????
[Subject] => ??????????????????????????
[UndefinedTag:0xEA1C] =>
[DateTimeOriginal] => 2022:08:14 10:01:02
[DateTimeDigitized] => 2022:08:14 10:01:02
[SubSecTimeOriginal] => 01
[SubSecTimeDigitized] => 01
)
XMP data in 'sample.jpg'
(Requires Imagemagick PHP extension)
No data
[end of XMP]
===> REMARK BY MYSELF
Output metadata.php show
(Requires Imagemagick PHP extension)
No data
[end of XMP]
===> But php/8.2 PHP Modules imagick is installed and XMP Metada does exist
//-------------------------
==> Output by exiftool.exe(-a -u -g1 -w txt)
Image Description : ImageDescription (Trunc FileName)
Software : Software Exiftool 12.70. (sample.jpg)
Artist : Artist (sample.jpg)
Copyright : Copyright (sample.jpg)
XP Title : XPTiltle 2024-01-01 (FileName)
XP Comment : XPComment (sample.jpg)
XP Author : XP Author (sample.jpg)
XP Keywords : XPkeyword1;keyword2;keyword3;mam;being mother
XP Subject : XPSubject (Trunc Filename)
Padding : (Binary data 268 bytes, use -b option to extract)
---- ExifIFD ----
Date/Time Original : 2022:08:14 10:01:02
Create Date : 2022:08:14 10:01:02
Sub Sec Time Original : 01
Sub Sec Time Digitized : 01
Padding : (Binary data 268 bytes, use -b option to extract)
---- IPTC ----
Keywords : IPTC being mother, IPTCkeyword1, keyword2, keyword3, mam
Application Record Version : 4
By-line : IPTC By-Line Artist
Object Name : IPTC ObjectName 2024-01-01 (FileName)
Date Created : 2022:08:14
Time Created : 10:01:02+02:00
Digital Creation Date : 2022:08:14
Digital Creation Time : 10:01:02+02:00
Copyright Notice : IPTC CopyRightNotice
Caption-Abstract : IPTC Caption-Abstract (Trunc FileName)
//=====================================================================================================================
Offline
The metadata.php simply uses the PHP function exif_read_data(), either that seems to be broken for some fields on your system (unlikely), or those fields contain non-ASCII characters and your system and PHP don't run in an UTF-8 locale context, or the field content is not in UTF-8 (you didn't provide a sample photo). Remarkably those are all fields that would be added by some photo editing or tagging software.
Offline
php/8.2 = default_charset Local Value=UTF-8 Master Value=UTF-8
For some reason i don't find how i can post the sample.jpg :-(
==> Remarkably those are all fields that would be added by some photo editing or tagging software.
And indeed i fill the same value in all fields exept the first word so i can see the name of the metafield
and there are no non-ASCII characters in them like you can see.
Offline
No I can't see because there is no sample image file with the original values. I only see what you pasted what your exiftool.exe apparently outputs. Simply provide a link or to embed an image here use a platform like https://imgur.com/
Offline
Tx for answer erAck
I din't even know this possiility.
Here is the link.
https://imgur.com/a/CfGMmda
Groofertje
Offline
The first image is the sample.jpg, where the 2 others just image's are in the shared folders.
Offline
Unfortunately Imgur seems to strip all metadata, there's none at all.
Best provide a link to your original image file.
Offline
You can use the link to my testserver if you like. eventually i give you admin access if you want.
I putted the sample.jpg into folder computers
https://test.swennenhome.be/
And srr for the problems, i'am glad that you want to help me.
Offline
Congratulations, it's utter Microsoft crap.
Following is the output of the immediate exif_read_data() arrays of your
https://test.swennenhome.be/galleries/T … 0alive.jpg as sample.jpg
using this PHP script:
<?php $exif = exif_read_data('sample.jpg', 0, true); echo "sample.jpg:\n"; foreach ($exif as $key => $section) { foreach ($section as $name => $val) { echo "$key.$name: "; print_r($val); echo "\n"; } } ?>
produces (raw data, not viewed in browser)
sample.jpg: FILE.FileName: sample.jpg FILE.FileDateTime: 1708620398 FILE.FileSize: 136476 FILE.FileType: 2 FILE.MimeType: image/jpeg FILE.SectionsFound: ANY_TAG, IFD0, EXIF, WINXP COMPUTED.html: width="880" height="513" COMPUTED.Height: 513 COMPUTED.Width: 880 COMPUTED.IsColor: 1 COMPUTED.ByteOrderMotorola: 1 COMPUTED.Copyright: groofie IFD0.ImageDescription: Are you alive IFD0.Software: 12.70 IFD0.Artist: Alison Wong IFD0.Copyright: groofie IFD0.Exif_IFD_Pointer: 668 IFD0.Title: 2^@0^@2^@4^@-^@0^@1^@-^@0^@1^@ ^@A^@r^@e^@ ^@y^@o^@u^@ ^@a^@l^@i^@v^@e^@^@^@ IFD0.Comments: B^@e^@i^@n^@g^@ ^@a^@ ^@m^@o^@m^@^@^@ IFD0.Author: A^@l^@i^@s^@o^@n^@ ^@W^@o^@n^@g^@^@^@ IFD0.Keywords: k^@e^@y^@w^@o^@r^@d^@1^@;^@k^@e^@y^@w^@o^@r^@d^@2^@;^@k^@e^@y^@w^@o^@r^@d^@3^@;^@m^@a^@m^@;^@b^@e^@i^@n^@g^@ ^@m^@o^@t^@h^@e^@r^@^@^@ IFD0.Subject: A^@r^@e^@ ^@y^@o^@u^@ ^@a^@l^@i^@v^@e^@^@^@ IFD0.UndefinedTag:0xEA1C: ^\ê^@^@^@^A^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@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P.Author: ??????????? WINXP.Keywords: ??????????????????????????????????????????? WINXP.Subject: ?????????????
where each "^@" represents a 0-byte. So there are at least two problems:
1. fields like IFD0.Title contain UCS2 16-bit Unicode characters
2. the WINXP.* fields yielding ???...
2) may be a consequence of the same cause of 1), UCS2 16-bit Unicode characters, that when read (as ASCII or even UTF-8) form invalid characters.
Whatever dirty MS tool you use on Windows to process images, don't.
Note that https://exiftool.org/TagNames/EXIF.html for 0x9c9b XPTitle and following says
"(tags 0x9c9b-0x9c9f are used by Windows Explorer; special characters in these values are converted to UTF-8 by default, or Windows Latin1 with the -L option. XPTitle is ignored by Windows Explorer if ImageDescription exists)".
Apparently that's odd here and exif_read_data() is not prepared to convert content of these specific fields from UCS2 to UTF-8.
Offline
OK tx for answer.
LOL I was using explorer from Win11 for filling the exiffields and then exiftool to copy the value of those fields into IPTC and XMP values. But i'am going to fllow your advise and never use this crap again and use now always exiftool for it.
Now i know where to look for i going to search how to convert al the exif in my photo's to UTF-8 code with exiftool. only some 3000 to go thus.
Problaby i'am going to use exiftool to do the revert and copy tha IPTC or XMP fields in those of EXIF.
But you really thank you for your advise and assist, because i should never found it myself.
Offline
Maybe this is a tip; For EXIF troubleshooting I used the "Read Metadata" plugin, which was a big help for myself.
Offline