Results 1 to 2 of 2

Thread: [RESOLVED] Reading image properties (the comments field)

  1. #1

    Thread Starter
    Fanatic Member neicedover1982's Avatar
    Join Date
    Jun 2005
    Posts
    566

    Resolved [RESOLVED] Reading image properties (the comments field)

    Hello, I am making a PHP photo album for my website. I am making it simple that you just drop the images into a folder and the script will automatically display the photos based on the catagories you choose.

    http://www.moonsofneptune.com/photos.php, that is the link to it. What I would really like to do is that, becuase I have information in the comments field of the image properties (just basic explinations about each image), is have a script read this information and display it under the image when they click one to blow up the full image.

    So when they click on an image, it will open in a custom window and the script will read the comment field and write it under the image. This way I can keep the album as simple as possible if other want to use it. You just edit the photos and dump them into folders and the scripts do the rest.

    Thank you for any help and the sooner the better, since I would like to get this working before a family party.
    Kevin | New England Iced Over | http://www.kevincawleyjr.com

  2. #2

    Thread Starter
    Fanatic Member neicedover1982's Avatar
    Join Date
    Jun 2005
    Posts
    566

    Re: Reading image properties (the comments field)

    I figured I would add more information. what I am doing to add the comments is to right click on the image and open the properties window. I then go to the Comments box and type them in. I uploaded the image and then downloaded the image and it turns out that the comment field was not kept, why is this? can i add comments to the photo in a program such as Fireworks so that the script will read it? I founf this code online but it doenst show any comment fields.
    VB Code:
    1. <?php
    2. echo "test1.jpg:<br />\n";
    3. $exif = exif_read_data('Animals/Lily/Page_1/My_Cat+(Lily,01).jpg', 'IFD0');
    4. echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";
    5.  
    6. $exif = exif_read_data('Animals/Lily/Page_1/My_Cat+(Lily,01).jpg', 0, true);
    7. echo "test2.jpg:<br />\n";
    8. foreach ($exif as $key => $section) {
    9.    foreach ($section as $name => $val) {
    10.        echo "$key.$name: $val<br />\n";
    11.    }
    12. }
    13. echo "<hr>";
    14. echo $section[20];
    15. ?>
    Kevin | New England Iced Over | http://www.kevincawleyjr.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width