src/PelJpeg.php
public static function isValid(PelDataWindow $d)
    {
        /* JPEG data is stored in big-endian format. */
        $d->setByteOrder(PelConvert::BIG_ENDIAN);

        $i = self::getJpgSectionStart($d);

        return $d->getByte($i) == PelJpegMarker::SOI;
    }
public static function isValid(PelDataWindow $d)
    {
        /* JPEG data is stored in big-endian format. */
        $d->setByteOrder(PelConvert::BIG_ENDIAN);

        $i = self::getJpgSectionStart($d);

        return $d->getByte($i) == PelJpegMarker::SOI;
    }
public static function isValid ( PelDataWindow $ d ) { /* JPEG data is stored in big-endian format. */ $ d -> setByteOrder ( PelConvert :: BIG_ENDIAN ) ; $ i = self :: getJpgSectionStart ( $ d ) ; return $ d -> getByte ( $ i ) == PelJpegMarker :: SOI ; }
Test data to see if it could be a valid JPEG image.

The function will only look at the first few bytes of the data,
and try to determine if it could be a valid JPEG image based on
those bytes. This means that the check is more like a heuristic
than a rigorous check.

@param
PelDataWindow the bytes that will be checked.

@return boolean true if the bytes look like the beginning of a
JPEG image, false otherwise.

@see PelTiff::isValid()
Test data to see if it could be a valid JPEG image .