Author Topic: Output data to a php page?  (Read 5399 times)

Offline rodneykm

  • Newcomer
  • *
  • Posts: 2
    • View Profile
Output data to a php page?
« on: August 07, 2006, 08:24:12 AM »
Can anyone help me with this. I need to know how to grab the IPTC data from the photos. Anyone ever done this?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25054
    • View Profile
    • Camera Bits, Inc.
Re: Output data to a php page?
« Reply #1 on: August 07, 2006, 07:34:41 PM »
Can anyone help me with this. I need to know how to grab the IPTC data from the photos. Anyone ever done this?

If you already know how to program in PHP, then I know that there is an IPTC module for PHP available somewhere.  Google will likely help you find it.

HTH,

-Kirk

Offline Primoz

  • Member
  • **
  • Posts: 81
    • View Profile
    • PhotoSI Sports photo agency
Re: Output data to a php page?
« Reply #2 on: August 09, 2006, 12:45:50 AM »
For my web (http://www.photo.si) I use PHP Metadata Toolkit (http://www.ozhiker.com/electronics/pjmt). It enables you to get IPTC from jpeg and after that you can do whatever you want with it including filling sql database so as I do. It wouldn't hurt if it would have some more documentation, but once you get basic idea you can customize it any way you want.

Offline rodneykm

  • Newcomer
  • *
  • Posts: 2
    • View Profile
Re: Output data to a php page?
« Reply #3 on: September 05, 2006, 11:28:25 AM »
Heres how I did it. Very rough grab of the code but should give you an idea.


// Grab all that crazy IPTC stuff from each image

$size    = GetImageSize ("/www/directory/$file/$image",&$info);
            $iptc    = iptcparse ($info["APP13"]);
            if (isset($info["APP13"])) {

//$iptc = iptcparse($info["APP13"]){
if (is_array($iptc)) {$caption = $iptc["2#120"][0]; }}
               
// Caption Display
      print ('<br>');
      print ('<span class=img_caption>');
      print ($caption);
      print ('<br>');
      print ('<b>Click Photo for Hi Res </b>');
      print ('</span>');
            }
            else
                echo $image;
                           
            print('</td>');
        }