What is the proper syntax for that function?
iptcembed('Cincinnati','https://www.stev.com/TMuploads/Hebe%20-%202022%202023%200107%201859%2010.jpg',['2#120'][0]);
I've manually inserted %20
for each space. I expected it to insert "Cincinnati" in a JPG file's IPTC metadata.
The definition of
iptcembed()
is:The third argument (
$spool
) is just a flag - an integer: if the value is less than2
, then the function will return a string. Otherwise (f.e. if it is equal to or higher than2
) then the JPEG data will be "printed" to STDOUT. The documentation for that argument reads:And the documentation on the function's return value mentions that you always have to expect the Boolean datatype when something goes wrong and a string can't be returned:
Making the iptc_data object is a bit tricky, so it's probably best to just use the sample code from the documentation of that function, particularly the
iptc_make_tag()
function given there: