Support Requests item #1022143, was opened at 2004-09-04 01:07 Message generated for change (Settings changed) made by mgeisler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=650323&aid=1022143&group_id=108380
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Martin Geisler (mgeisler) Summary: Sample code for writing exif tags? Initial Comment: Is there anywhere any sample code provided that shows how exactly to add or change an exif tag's content for a given image? I tried as hard as I could, but I couldn't get it to work. The changes could be made but were not saved to the image. Thanks, Rude chaeskey (at) gmx.net ---------------------------------------------------------------------- Comment By: Martin Geisler (gimpster) Date: 2004-09-25 13:45 Message: Logged In: YES user_id=104098 Did the work-a-round proposed work? If not, then please reopen this support request. ---------------------------------------------------------------------- Comment By: Martin Geisler (gimpster) Date: 2004-09-14 00:31 Message: Logged In: YES user_id=104098 Okay... your installation of PHP lacks support for Gettext, which is used by PEL to handle the translations. You can either recompile PHP with Gettext support, or use the following code, which should provide you with a work-a-round. PEL will work, but without translations: if (function_exists('dgettext')) { bindtextdomain('pel', dirname(__FILE__) . '/locale'); } else { function dgettext($domain, $str) { return $str; } } Put the code in Pel.php, replacing the one line with bindtextdomain(...). I'm looking forward to hear if it helped with the Gettext problems. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2004-09-13 22:27 Message: Logged In: NO Thank you very much for your reply! Sorry, but the sent code just returns a "Fatal error: Call to undefined function bindtextdomain() in D:\Websites\htdocs_testweb\pel\pel-0.6\Pel.php on line 46". Which is funny, because that's a standard php function. I had this before, but now I did a re-install of php (5.0.1) and pel, and this error still occurrs. Any way you can point me? Thank you very much in advance! Rude chaeskey (at) gmx.net ---------------------------------------------------------------------- Comment By: Martin Geisler (gimpster) Date: 2004-09-04 10:34 Message: Logged In: YES user_id=104098 There is the script called edit-description.php in the test directory. It will load an image and change the IMAGE_DESCRIPTION tag to whatever commandline arguments the script received. The basic way to do this is the following: $jpeg = new PelJpeg(); $jpeg->load(new PelDataWindow(file_get_contents($file))); $app1 = $jpeg->getSection(PelJpegMarker::APP1); $tiff = $app1->getTiff(); $ifd0 = $tiff->getIfd(); $desc = $ifd0->getEntry(PelTag::IMAGE_DESCRIPTION); $desc->setValue('My new shiny description!'); file_put_contents('new.jpg', $jpeg->getBytes()); That was the whole thing just for completeness... I believe you missed the very last bit with the call to $jpeg->getBytes(). That call will give you bytes from the JPEG object, and recursively for the sub objects, including the changed description. I hope this helps, if not, then please ask again. -- Martin Geisler ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=650323&aid=1022143&group_id=108380 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ PEL-devel mailing list PEL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pel-devel