src/PelConvert.php
public static function bytesToSShort($bytes, $offset, $endian)
    {
        $n = self::bytesToShort($bytes, $offset, $endian);
        if ($n > 32767) {
            return $n - 65536;
        } else {
            return $n;
        }
    }
public static function bytesToSShort($bytes, $offset, $endian)
    {
        $n = self::bytesToShort($bytes, $offset, $endian);
        if ($n > 32767) {
            return $n - 65536;
        } else {
            return $n;
        }
    }
public static function bytesToSShort ( $ bytes , $ offset , $ endian ) { $ n = self :: bytesToShort ( $ bytes , $ offset , $ endian ) ; if ( $ n > 32767 ) { return $ n - 65536 ; } else { return $ n ; } }
Extract a signed short from bytes.

@param string $bytes

@param integer $offset
The short found at offset will be returned
as an integer. There must be at least two bytes available
beginning at the offset given.
@param boolean $endian
one of {@link LITTLE_ENDIAN} and {@link
BIG_ENDIAN}.
@return integer the signed byte found at offset, e.g., an integer in
the range -32768 to 32767.
Extract a signed short from bytes .