After some searching and testing, I believe there is an issue with the character encoding of the string PHP is returning me. The EXIF UserComment field for each of my JPG files contains a comment string in Unicode, and evidently there is some issue when retrieving it through the following code:
<? $exif = exif_read_data($fileloc, 0, true); $computedvals = $exif['COMPUTED']; $caption = $computedvals['UserComment']; ?> <html><body> <? echo ($caption); ?> </body><html>
Here is an example of the output I'm getting:
[a href=\"http://www.skyinmotion.com/viewphoto.php?gallery=Landscape&filepath=http://www.skyinmotion.com/photos/landscape&filename=CRW_5054.jpg\" target=\"_blank\"]http://www.skyinmotion.com/viewphoto.php?g...me=CRW_5054.jpg[/a]
Note the last line of text before the "back" link at the bottom. For me, when using Firefox there is a jarbled mess of unreadable characters between the proper characters, and when using IE the spacing is incorrect -- either way, there is some type of character encoding issue. Regardless, if you look at the HTML for this page the caption is not the same as the string in the EXIF field. The actual contents of the UserComment EXIF field for this file are: "Lake Guntersville, Guntersville, AL"
My guess is that I need to correct this by converting the string PHP is returning in my $caption variable in the code above to Unicode, but from what character set I am not sure. My goal is to obtain a string that is identical to the comment I type into the EXIF UserComment file for an image.
Any help would be appreciated!