0

I only want to add the 2 fields required by Google for the Licensable badge:

  • Web Statement of Rights
  • Licensor URL

I'm able to write standard IPTC fields but these two seems to require XMP.

As a newbie, I've been searching for hours and got lost in a maze of classes, libraries, packages requiring Composer(?) or npm(?), cryptic examples assuming previous knowledge, downloaded stuff which doesn't work because I'm probably using them wrong, etc.

If someone could give me a code-complete example, or pointers to such, I'd much appreciate it.

Kerans
  • 115
  • 1
  • 17

3 Answers3

1

Exiftool is my preferred way of writing XMP. There are some PHP libraries for using it but exec() can work as well if you know the commands.

A simple example for the Web Statement of Rights is:

exec('exiftool -xmp-xmpRights:WebStatement="http://example.com" image.jpg', $output, $returnCode);
cOle2
  • 4,725
  • 1
  • 24
  • 26
  • Thanks for this suggestion. I tried it and I got a return code of 127, which I understand means the program was not found? After looking around, I tried installing the Perl module Image::ExifTool(12.16) I found in my cPanel, but it ended in error: The C compiler is not functional and auto repair failed. I'm just about ready to give up now. Thanks anyway. – Kerans Mar 31 '21 at 19:30
0

I had the same problem with the 127 error code on my Mac. Someone suggested that I put in the complete path to exiftool and that got rid of the 127 error. Now I have another error but at least it's coming from exiftool. On my Mac the pathname I used is /usr/local/bin/exiftool.

Garr Lystad
  • 41
  • 1
  • 5
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/30176365) – Kristian Oct 26 '21 at 01:56
-1

I have exactly the same problem like the original questioner and wonder if there's a solution in PHP, beside the exiftool which also doesn't work with me.

On a german magazine website I found the frustrating sentence: "XMP-Metadaten sind in PHP nicht vorgesehen." (engl. "XMP metadata is not intended in PHP.")

https://www.pc-magazin.de/ratgeber/php-iptc-exif-bearbeiten-3202457.html

Thomas
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 05 '21 at 16:34
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/30511764) – micke Dec 06 '21 at 10:12