Source for file PelJpegComment.php

Documentation is available at PelJpegComment.php

  1. <?php
  2.  
  3. /*  PEL: PHP Exif Library.  A library with support for reading and
  4.  *  writing all Exif headers in JPEG and TIFF images using PHP.
  5.  *
  6.  *  Copyright (C) 2005, 2007  Martin Geisler.
  7.  *
  8.  *  This program is free software; you can redistribute it and/or modify
  9.  *  it under the terms of the GNU General Public License as published by
  10.  *  the Free Software Foundation; either version 2 of the License, or
  11.  *  (at your option) any later version.
  12.  *
  13.  *  This program is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with this program in the file COPYING; if not, write to the
  20.  *  Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  21.  *  Boston, MA 02110-1301 USA
  22.  */
  23.  
  24. /* $Id$ */
  25.  
  26.  
  27. /**
  28.  * Class for dealing with JPEG comments.
  29.  *
  30.  * @author Martin Geisler <mgeisler@users.sourceforge.net>
  31.  * @version $Revision$
  32.  * @date $Date$
  33.  * @license http://www.gnu.org/licenses/gpl.html GNU General Public
  34.  *  License (GPL)
  35.  * @package PEL
  36.  */
  37.  
  38. /**#@+ Required class definitions. */
  39. require_once('PelJpegContent.php');
  40. /**#@-*/
  41.  
  42.  
  43. /**
  44.  * Class representing JPEG comments.
  45.  *
  46.  * @author Martin Geisler <mgeisler@users.sourceforge.net>
  47.  * @package PEL
  48.  */
  49. class PelJpegComment extends PelJpegContent {
  50.  
  51.   /**
  52.    * The comment.
  53.    *
  54.    * @var string 
  55.    */
  56.   private $comment '';
  57.  
  58.   /**
  59.    * Construct a new JPEG comment.
  60.    *
  61.    * The new comment will contain the string given.
  62.    */
  63.   function __construct($comment ''{
  64.     $this->comment $comment;
  65.   }
  66.  
  67.  
  68.   /**
  69.    * Load and parse data.
  70.    *
  71.    * This will load the comment from the data window passed.
  72.    */
  73.   function load(PelDataWindow $d{
  74.     $this->comment $d->getBytes();
  75.   }
  76.  
  77.  
  78.   /**
  79.    * Update the value with a new comment.
  80.    *
  81.    * Any old comment will be overwritten.
  82.    *
  83.    * @param string the new comment.
  84.    */
  85.   function setValue($comment{
  86.     $this->comment $comment;
  87.   }
  88.  
  89.  
  90.   /**
  91.    * Get the comment.
  92.    *
  93.    * @return string the comment.
  94.    */
  95.   function getValue({
  96.     return $this->comment;
  97.   }
  98.  
  99.  
  100.   /**
  101.    * Turn this comment into bytes.
  102.    *
  103.    * @return string bytes representing this comment.
  104.    */
  105.   function getBytes({
  106.     return $this->comment;
  107.   }
  108.  
  109.  
  110.   /**
  111.    * Return a string representation of this object.
  112.    *
  113.    * @return string the same as {@link getValue()}.
  114.    */
  115.   function __toString({
  116.     return $this->getValue();
  117.   }
  118.  
  119. }
  120.  
  121. ?>

Documentation generated on Thu, 05 May 2011 07:19:19 +0200 by phpDocumentor 1.4.3