Source for file PelJpegMarker.php
Documentation is available at PelJpegMarker.php
/* PEL: PHP Exif Library. A library with support for reading and
* writing all Exif headers in JPEG and TIFF images using PHP.
* Copyright (C) 2004, 2005, 2006 Martin Geisler.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program in the file COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
* Classes for dealing with JPEG markers.
* @author Martin Geisler <mgeisler@users.sourceforge.net>
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
/**#@+ Required class definitions. */
* Class with static methods for JPEG markers.
* This class defines the constants to be used whenever one refers to
* a JPEG marker. All the methods defined are static, and they all
* operate on one argument which should be one of the class constants.
* They will all be denoted by PelJpegMarker in the documentation.
* @author Martin Geisler <mgeisler@users.sourceforge.net>
/** Encoding (baseline) */
/** Encoding (extended sequential) */
/** Encoding (progressive) */
/** Encoding (lossless) */
/** Define Huffman table */
/** Encoding (differential sequential) */
/** Encoding (differential progressive) */
/** Encoding (differential lossless) */
/** Encoding (extended sequential, arithmetic) */
/** Encoding (progressive, arithmetic) */
/** Encoding (lossless, arithmetic) */
/** Define arithmetic coding conditioning */
/** Encoding (differential sequential, arithmetic) */
/** Encoding (differential progressive, arithmetic) */
/** Encoding (differential lossless, arithmetic) */
/** Define quantization table */
/** Define number of lines */
/** Define restart interval */
/** Define hierarchical progression */
/** Expand reference component */
/** Application segment 0 */
* When a JPEG image contains Exif data, the data will normally be
* stored in this section and a call to {@link PelJpeg::getExif()}
* will return a {@link PelExif} object representing it.
/** Application segment 2 */
/** Application segment 3 */
/** Application segment 4 */
/** Application segment 5 */
/** Application segment 6 */
/** Application segment 7 */
/** Application segment 8 */
/** Application segment 9 */
/** Application segment 10 */
/** Application segment 11 */
/** Application segment 12 */
/** Application segment 13 */
/** Application segment 14 */
/** Application segment 15 */
* Check if a byte is a valid JPEG marker.
* @param PelJpegMarker the byte that will be checked.
* @return boolean if the byte is recognized true is returned,
* otherwise false will be returned.
return ($m >=
self::SOF0 &&
$m <=
self::COM);
* Turn a JPEG marker into bytes.
* @param PelJpegMarker the marker.
* @return string the marker as a string. This will be a string
* with just a single byte since all JPEG markers are simply single
* Return the short name for a marker.
* @param PelJpegMarker the marker.
* @return string the name of the marker, e.g., 'SOI' for the Start
case self::SOF0:
return 'SOF0';
case self::SOF1:
return 'SOF1';
case self::SOF2:
return 'SOF2';
case self::SOF3:
return 'SOF3';
case self::SOF5:
return 'SOF5';
case self::SOF6:
return 'SOF6';
case self::SOF7:
return 'SOF7';
case self::SOF9:
return 'SOF9';
case self::SOF10:
return 'SOF10';
case self::SOF11:
return 'SOF11';
case self::SOF13:
return 'SOF13';
case self::SOF14:
return 'SOF14';
case self::SOF15:
return 'SOF15';
case self::SOI:
return 'SOI';
case self::EOI:
return 'EOI';
case self::SOS:
return 'SOS';
case self::COM:
return 'COM';
case self::DHT:
return 'DHT';
case self::JPG:
return 'JPG';
case self::DAC:
return 'DAC';
case self::RST0:
return 'RST0';
case self::RST1:
return 'RST1';
case self::RST2:
return 'RST2';
case self::RST3:
return 'RST3';
case self::RST4:
return 'RST4';
case self::RST5:
return 'RST5';
case self::RST6:
return 'RST6';
case self::RST7:
return 'RST7';
case self::DQT:
return 'DQT';
case self::DNL:
return 'DNL';
case self::DRI:
return 'DRI';
case self::DHP:
return 'DHP';
case self::EXP:
return 'EXP';
case self::APP0:
return 'APP0';
case self::APP1:
return 'APP1';
case self::APP2:
return 'APP2';
case self::APP3:
return 'APP3';
case self::APP4:
return 'APP4';
case self::APP5:
return 'APP5';
case self::APP6:
return 'APP6';
case self::APP7:
return 'APP7';
case self::APP8:
return 'APP8';
case self::APP9:
return 'APP9';
case self::APP10:
return 'APP10';
case self::APP11:
return 'APP11';
case self::APP12:
return 'APP12';
case self::APP13:
return 'APP13';
case self::APP14:
return 'APP14';
case self::APP15:
return 'APP15';
case self::JPG0:
return 'JPG0';
case self::JPG1:
return 'JPG1';
case self::JPG2:
return 'JPG2';
case self::JPG3:
return 'JPG3';
case self::JPG4:
return 'JPG4';
case self::JPG5:
return 'JPG5';
case self::JPG6:
return 'JPG6';
case self::JPG7:
return 'JPG7';
case self::JPG8:
return 'JPG8';
case self::JPG9:
return 'JPG9';
case self::JPG10:
return 'JPG10';
case self::JPG11:
return 'JPG11';
case self::JPG12:
return 'JPG12';
case self::JPG13:
return 'JPG13';
case self::COM:
return 'COM';
default:
return Pel::fmt('Unknown marker: 0x%02X', $m);
* Returns a description of a JPEG marker.
* @param PelJpegMarker the marker.
* @return string the description of the marker.
return Pel::tra('Encoding (baseline)');
return Pel::tra('Encoding (extended sequential)');
return Pel::tra('Encoding (progressive)');
return Pel::tra('Encoding (lossless)');
return Pel::tra('Encoding (differential sequential)');
return Pel::tra('Encoding (differential progressive)');
return Pel::tra('Encoding (differential lossless)');
return Pel::tra('Encoding (extended sequential, arithmetic)');
return Pel::tra('Encoding (progressive, arithmetic)');
return Pel::tra('Encoding (lossless, arithmetic)');
return Pel::tra('Encoding (differential sequential, arithmetic)');
return Pel::tra('Encoding (differential progressive, arithmetic)');
return Pel::tra('Encoding (differential lossless, arithmetic)');
return Pel::tra('Start of image');
return Pel::tra('End of image');
return Pel::tra('Start of scan');
return Pel::tra('Define Huffman table');
return Pel::tra('Define arithmetic coding conditioning');
return Pel::fmt('Restart %d', 0);
return Pel::fmt('Restart %d', 1);
return Pel::fmt('Restart %d', 2);
return Pel::fmt('Restart %d', 3);
return Pel::fmt('Restart %d', 4);
return Pel::fmt('Restart %d', 5);
return Pel::fmt('Restart %d', 6);
return Pel::fmt('Restart %d', 7);
return Pel::tra('Define quantization table');
return Pel::tra('Define number of lines');
return Pel::tra('Define restart interval');
return Pel::tra('Define hierarchical progression');
return Pel::tra('Expand reference component');
return Pel::fmt('Application segment %d', 0);
return Pel::fmt('Application segment %d', 1);
return Pel::fmt('Application segment %d', 2);
return Pel::fmt('Application segment %d', 3);
return Pel::fmt('Application segment %d', 4);
return Pel::fmt('Application segment %d', 5);
return Pel::fmt('Application segment %d', 6);
return Pel::fmt('Application segment %d', 7);
return Pel::fmt('Application segment %d', 8);
return Pel::fmt('Application segment %d', 9);
return Pel::fmt('Application segment %d', 10);
return Pel::fmt('Application segment %d', 11);
return Pel::fmt('Application segment %d', 12);
return Pel::fmt('Application segment %d', 13);
return Pel::fmt('Application segment %d', 14);
return Pel::fmt('Application segment %d', 15);
return Pel::fmt('Extension %d', 0);
return Pel::fmt('Extension %d', 1);
return Pel::fmt('Extension %d', 2);
return Pel::fmt('Extension %d', 3);
return Pel::fmt('Extension %d', 4);
return Pel::fmt('Extension %d', 5);
return Pel::fmt('Extension %d', 6);
return Pel::fmt('Extension %d', 7);
return Pel::fmt('Extension %d', 8);
return Pel::fmt('Extension %d', 9);
return Pel::fmt('Extension %d', 10);
return Pel::fmt('Extension %d', 11);
return Pel::fmt('Extension %d', 12);
return Pel::fmt('Extension %d', 13);
return Pel::fmt('Unknown marker: 0x%02X', $m);
Documentation generated on Thu, 05 May 2011 07:19:22 +0200 by phpDocumentor 1.4.3