Specifying image description with FTP upload

Hi there,

I'm doing a very simple integration of Zenphoto simply by taking publicly uploaded files through a form and moving them to an album folder, where they can be approved for publishing afterwards.

The photos conveniently use the filenames as titles. Is there a way I could also specify the description? Be it in the filename or by somehow interacting with the Zenphoto code?

Thanks!

Comments

  • acrylian Administrator, Developer
    Use EXIF meta data.
  • Perfect -- thank you!

    For future Googlers who may stumble across my post, there are a lot of complex image libraries out there that rank highly when searching, but you can pull this off with built-in PHP functions by first stripping out existing EXIF data by recreating the image like so:
    <?php
    $path = 'pathtoimage.jpg';
    $img = imagecreatefromjpeg ($path);
    imagejpeg ($img, $path);
    imagedestroy ($img);
    ?>

    Then embedding the new data using the example code here: http://php.net/manual/en/function.iptcembed.php
    The line '2#120' => 'Test image' is what corresponds to the image description.
Sign In or Register to comment.