note 42168 added to function.iptcembed
| From: | dj dot cyberdance at gmx dot at | Date: | Thu, 06 May 2004 08:29:48 +0000 |
| Subject: | note 42168 added to function.iptcembed | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69268@lists.php.net to get a copy of this message | ||
I've spent a whole day debugging my code (that was based on the example below, posted by knut)
until I found out, that iptcembed() only works if the image specified in jpeg_file_name already has
IPTC fields included.
That means that you cannot write IPTC fields in a jpeg file without preexisting IPTC information in
it.
Updating of IPTC fields also worked only with a few files, I don't really know what it depends
on whether it works or not. (Well, it depends on the IPTC header, that's for sure :-)
I'm using PHP 4.2.1, maybe this is fixed in more recent versions, but I don't believe...
Nevertheless, here's some piece of code I tried:
I replaced the line
<?
$iptc_old = iptcparse ($info["APP13"]);
?>
from knut's example below with
<?
$iptc_old["2#000"][0] = chr(0) . chr(2);
?>
This creates just an empty "Header" according to the IPTC spec. This one also is included
when getting IPTC info using iptcparse(). So my intention was to create a fully new header, but when
using iptcembed() afterwards, the file size of the new file was a little smaller than the original
but without any IPTC info stored in it.
----
Manual Page -- http://www.php.net/manual/en/function.iptcembed.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42168
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42168&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42168&report=yes
Search -- http://master.php.net/manage/user-notes.php