Line Breaks in EXIF data?

Is there any way to get ZenPhoto to recognize line breaks in EXIF data?

My descriptions really run together like the following example: http://www.zerflin.com/ZenPhoto/index.php?album=works/Vector+Things&image=Stars+Page+5-6.jpg

Is there anything I can do?

Comments

  • Any ideas?
  • You could insert code to replace the line endings with `
    `. It is probably not a good idea for zenphoto to do it since the behavior depends on where it is being displayed. In `alt=` text you want the line ends. In HTML you want the `
    `.

    `echo str_replace("n", $exiftext);` should do it.
  • I'm not sure I get what you mean... where else would the EXIF data be displayed in ZenPhoto other than in the image preview?

    And where does that code go? Somewhere in image.php?
  • Your example seems to no longer be there. `printImageDesc()` already replaces line breaks with , so I don't know which EXIF data is causing you the problem. But when you print that data is where you would have to replace the new lines with the .

    In general, zenphoto will format the output if you are using a printXXX() function but will not format it if you are using a getXXX() function. So wherever you use the getXXX() function and then display the result you would need to replace the line feeds by the . By the way, the code above did not display correctly. And it does not deal with return characters.

    Here is the corrected code (if I can make it show.)

    ` $desc = htmlspecialchars(getImageDesc());

    $desc = str_replace("\r\n", "\n", $desc);

    $desc = str_replace("\n", "
    ", $desc);`
  • Hi sbillard,
    I'm still having trouble with this.

    It seems like when the EXIF data is imported, it looses the line breaks.

    Here is one image, just imported: http://www.zerflin.com/ZenPhoto/index.php?album=services/Portrait+Photography&image=Jamel+McMillian.jpg

    However, once I click on the description in the editor (when the full view of the image is displayed), the line breaks show up. Upon hitting save, it looks like this photo here: http://zerflin.com/ZenPhoto/index.php?album=artwork/Photography+People&image=Jamel+McMillian.jpg
  • Line endings are a funny thing. Unfortunately they are not standardized. You will have to figure out what is being used as a line break in your EXIF and use the code above to change it into the `
    ` HTML.
  • I see. Do you know a way I can break into the EXIF code in an image?
    Currently, I'm using Adobe Bridge to edit the EXIF data.
  • exiftool is a great command line EXIF editor: http://www.sno.phy.queensu.ca/~phil/exiftool/

    I have used it under Linux and Cygwin, there is a windows version of it as well.
  • I downloaded and installed it... but I have no idea how to use it.

    How does this work? How do I get it to read an image? I opened up Terminal and I got this:

    EXIFTOOL(1) User Contributed Perl Documentation EXIFTOOL(1)

    NAME
    exiftool - Read and write meta information in files

    SYNOPSIS
    exiftool [OPTIONS] [-TAG...] [--TAG...] FILE...

    exiftool [OPTIONS] -TAG[+-<]=[VALUE]... FILE...

    exiftool [OPTIONS] -tagsFromFile SRCFILE [-SRCTAG[>DSTTAG]...] FILE...

    exiftool [ -ver | -list[w|f|wf|g[NUM]|d] ]

    For specific examples, see the EXAMPLES sections below.

    DESCRIPTION
    A command-line interface to Image::ExifTool, used for reading and writ-
    ing meta information in image, audio and video files. FILE is a source
    file name, directory name, or "-" for the standard input. Information
    is read from the source file and output in readable form to the console
    (or written to an output text file with the -w option).

    To write or copy information, new values are specified with the
    -TAG=[VALUE] syntax or the -tagsFromFile option. This causes FILE to
    be rewritten, and by default the original file is preserved with
    "_original" appended to the file name. (Be sure to verify that the new
    file is OK before erasing the original.) Once in write mode, exiftool
    :
  • You can run `exiftool image.jpg` to get all EXIF data from the file.

    Specific to what you're doing, `exiftool -ImageDescription image.jpg` should give you the image description. To modify the image description: `exiftool -ImageDescription+="text" image.jpg`.
  • eF Member
    you can get an GUY at this adress:

    http://freeweb.siol.net/hrastni3/foto/exif/exiftoolgui.htm.

    It will permit to use Exiftools in and very friendly interface.

    Hope that's help

    eF!
Sign In or Register to comment.