MediaWiki  REL1_19
JpegMetadataExtractor Class Reference

Class for reading jpegs and extracting metadata. More...

List of all members.

Static Public Member Functions

static doPSIR ($app13)
 This reads the photoshop image resource.
static segmentSplitter ($filename)
 Function to extract metadata segments of interest from jpeg files based on GIFMetadataExtractor.

Public Attributes

const MAX_JPEG_SEGMENTS = 200

Static Private Member Functions

static jpegExtractMarker (&$fh)
 Helper function for jpegSegmentSplitter.

Detailed Description

Class for reading jpegs and extracting metadata.

see also BitmapMetadataHandler.

Based somewhat on GIFMetadataExtrator.

Definition at line 8 of file JpegMetadataExtractor.php.


Member Function Documentation

static JpegMetadataExtractor::doPSIR ( app13) [static]

This reads the photoshop image resource.

Currently it only compares the iptc/iim hash with the stored hash, which is used to determine the precedence of the iptc data. In future it may extract some other info, like url of copyright license.

This should generally be called by BitmapMetadataHandler::doApp13()

Parameters:
String$app13photoshop psir app13 block from jpg.
Exceptions:
MWException(It gets caught next level up though)
Returns:
String if the iptc hash is good or not.

Definition at line 169 of file JpegMetadataExtractor.php.

References wfUnpack().

Referenced by BitmapMetadataHandler\doApp13(), JpegMetadataExtractorTest\testIPTCHashComparisionBadHash(), JpegMetadataExtractorTest\testIPTCHashComparisionGoodHash(), and JpegMetadataExtractorTest\testIPTCHashComparisionNoHash().

Here is the call graph for this function:

Here is the caller graph for this function:

static JpegMetadataExtractor::jpegExtractMarker ( &$  fh) [static, private]

Helper function for jpegSegmentSplitter.

Parameters:
&$fhFileHandle for jpeg file
Returns:
data content of segment.

Definition at line 148 of file JpegMetadataExtractor.php.

References $size, and wfUnpack().

Referenced by segmentSplitter().

Here is the call graph for this function:

Here is the caller graph for this function:

static JpegMetadataExtractor::segmentSplitter ( filename) [static]

Function to extract metadata segments of interest from jpeg files based on GIFMetadataExtractor.

we can almost use getimagesize to do this but gis doesn't support having multiple app1 segments and those can't extract xmp on files containing both exif and xmp data

Parameters:
String$filenamename of jpeg file
Returns:
Array of interesting segments.
Exceptions:
MWExceptionif given invalid file.

Definition at line 26 of file JpegMetadataExtractor.php.

References $size, jpegExtractMarker(), UtfNormal\quickIsNFCVerify(), wfDebug(), wfRestoreWarnings(), wfSuppressWarnings(), and wfUnpack().

Referenced by BitmapMetadataHandler\Jpeg(), JpegMetadataExtractorTest\testBinaryCommentStripped(), JpegMetadataExtractorTest\testExifByteOrder(), ExifTest\testGPSExtraction(), JpegMetadataExtractorTest\testIPTCHashComparisionBadHash(), JpegMetadataExtractorTest\testIPTCHashComparisionGoodHash(), JpegMetadataExtractorTest\testIPTCHashComparisionNoHash(), JpegMetadataExtractorTest\testIso88591Comment(), JpegMetadataExtractorTest\testMultipleComment(), JpegMetadataExtractorTest\testPSIRExtraction(), ExifTest\testUnicodeUserComment(), JpegMetadataExtractorTest\testUtf8Comment(), JpegMetadataExtractorTest\testXMPExtraction(), and JpegMetadataExtractorTest\testXMPExtractionAltAppId().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation


The documentation for this class was generated from the following file: