Jump to content

brettjrob

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by brettjrob

  1. Thanks, I appreciate it! That is interesting how it looks different in your Firefox. I am utterly clueless about "character encoding" and "character sets" so I won't even try to speculate as to what settings on each of our systems or browsers may be the cause. I did notice, though, that in your screenshot there are spaces between each character which are not present in the actual EXIF data embedded in the JPG file. My real goal here is to obtain a string that contains exactly what is in the EXIF UserComment field. For what it's worth, I downloaded Apache and PHP 4.4.2 this afternoon and installed them on my WinXP machine and, with all the pertinent settings remaining on default, I did not encounter this issue when testing locally -- the string $caption from the code above was identical to what I had typed into the EXIF field, so perhaps there is some configuration on this server that I need to work around?
  2. I'm a brand new user here, and I'm working on creating a basic PHP photo gallery. The gallery portion seems to be working well at this point (displaying a thumbnail and link for each photo inside a directory), but the page to display an individual photo is giving me quite the headache. What I wanted to do was extract a few EXIF properties from each JPG file to write onto the page... I had no trouble doing so using exif_read_data() to get the date and certain camera settings, but when I attempt to print the UserComment field, I get a jarbled mess in Firefox (but not IE). After some searching and testing (keep in mind I am completely new to PHP and web development in general so I may well be missing something here), 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: http://www.skyinmotion.com/viewphoto.php?g...me=CRW_5054.jpg 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. The actual contents of the UserComment 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. Any help would be appreciated!
×
×
  • Create New...