Lines Matching defs:pos

1521             $pos = 0;
1542 $this->_info['sof']['SamplePrecision'] = $this->_getByte($data, $pos + 0);
1543 $this->_info['sof']['ImageHeight'] = $this->_getShort($data, $pos + 1);
1544 $this->_info['sof']['ImageWidth'] = $this->_getShort($data, $pos + 3);
1545 $this->_info['sof']['ColorChannels'] = $this->_getByte($data, $pos + 5);
1693 $pos = 6;
1696 // We don't increment $pos after this because Exif uses offsets relative to this point
1698 $byteAlign = $this->_getShort($data, $pos + 0);
1708 $alignCheck = $this->_getShort($data, $pos + 2, $isBigEndian);
1718 $offsetIFD0 = $this->_getLong($data, $pos + 4, $isBigEndian);
1722 $offsetIFD1 = $this->_readIFD($data, $pos, $offsetIFD0, $isBigEndian, 'ifd0');
1724 $this->_readIFD($data, $pos, $offsetIFD1, $isBigEndian, 'ifd1');
1975 $pos = 6;
1981 $pos = $this->_putString($data, $pos, $aux);
1985 $pos = $this->_putString($data, $pos, $aux);
1987 $pos = $this->_putShort($data, $pos, 0x002A, $isBigEndian);
1988 $pos = $this->_putLong($data, $pos, 0x00000008, $isBigEndian); // IFD0 Offset is always 8
1993 $pos = $this->_writeIFD($data, $pos, $offsetBase, $ifd0, $isBigEndian, true);
1994 $pos = $this->_writeIFD($data, $pos, $offsetBase, $ifd1, $isBigEndian, false);
2003 * @param integer $pos
2011 function _writeIFD(&$data, $pos, $offsetBase, &$entries, $isBigEndian, $hasNext) {
2017 $dataPos = $pos + 2 + ($entryCount * 12) + 4;
2018 $pos = $this->_putShort($data, $pos, $entryCount, $isBigEndian);
2025 $pos = $this->_putShort($data, $pos, $tag, $isBigEndian);
2026 $pos = $this->_putShort($data, $pos, 0x04, $isBigEndian); // LONG
2027 $pos = $this->_putLong($data, $pos, 0x01, $isBigEndian); // Count = 1
2028 $pos = $this->_putLong($data, $pos, $dataPos - $offsetBase, $isBigEndian);
2032 $pos = $this->_putShort($data, $pos, $tag, $isBigEndian);
2033 $pos = $this->_putShort($data, $pos, 0x04, $isBigEndian); // LONG
2034 $pos = $this->_putLong($data, $pos, 0x01, $isBigEndian); // Count = 1
2035 $tiffDataOffsetPos = $pos;
2036 $pos = $this->_putLong($data, $pos, 0x00, $isBigEndian); // For Now
2039 $pos = $this->_putShort($data, $pos, $tag, $isBigEndian);
2040 $pos = $this->_putShort($data, $pos, $type, $isBigEndian);
2041 $pos = $this->_putLong($data, $pos, $entries[$i]['count'], $isBigEndian);
2043 $pos = $this->_putLong($data, $pos, $dataPos - $offsetBase, $isBigEndian);
2047 $pos = $this->_putString($data, $pos, $val);
2058 $pos = $this->_putLong($data, $pos, $dataPos - $offsetBase, $isBigEndian);
2060 $pos = $this->_putLong($data, $pos, 0, $isBigEndian);
2437 $pos = 14;
2444 while ($pos < $datasize) {
2445 $signature = $this->_getFixedString($data, $pos, 4);
2448 $pos += 4;
2450 $type = $this->_getShort($data, $pos);
2451 $pos += 2;
2453 $strlen = $this->_getByte($data, $pos);
2454 $pos += 1;
2457 $header .= $data[$pos + $i];
2459 $pos += $strlen + 1 - ($strlen % 2); // The string is padded to even length, counting the length byte itself
2461 $length = $this->_getLong($data, $pos);
2462 $pos += 4;
2464 $basePos = $pos;
2468 $pos = $this->_readIPTC($data, $pos);
2469 if ($pos == false)
2473 $this->_info['adobe']['CopyrightFlag'] = $this->_getByte($data, $pos);
2474 $pos += $length;
2477 $this->_info['adobe']['ImageURL'] = $this->_getFixedString($data, $pos, $length);
2478 $pos += $length;
2481 $aux = $this->_getLong($data, $pos);
2482 $pos += 4;
2484 $this->_info['adobe']['ThumbnailWidth'] = $this->_getLong($data, $pos);
2485 $pos += 4;
2486 $this->_info['adobe']['ThumbnailHeight'] = $this->_getLong($data, $pos);
2487 $pos += 4;
2489 $pos += 16; // Skip some data
2491 $this->_info['adobe']['ThumbnailData'] = $this->_getFixedString($data, $pos, $length - 28);
2492 $pos += $length - 28;
2506 $pos = $basePos + $length + ($length % 2); // Even padding
2517 function _readIPTC(&$data, $pos = 0) {
2522 while ($pos < ($totalLength - 5)) {
2523 $signature = $this->_getShort($data, $pos);
2525 return $pos;
2526 $pos += 2;
2528 $type = $this->_getByte($data, $pos);
2529 $pos += 1;
2530 $length = $this->_getShort($data, $pos);
2531 $pos += 2;
2533 $basePos = $pos;
2549 $this->_info['iptc'][$label][ count($this->_info['iptc'][$label]) ] = $this->_getFixedString($data, $pos, $length);
2551 $this->_info['iptc'][$label] = $this->_getFixedString($data, $pos, $length);
2555 $pos = $basePos + $length; // No padding
2557 return $pos;
2579 $pos = 14;
2583 $pos = $this->_write8BIM(
2585 $pos,
2599 * @param integer $pos
2607 function _write8BIM(&$data, $pos, $type, $header, &$value) {
2610 $pos = $this->_putString($data, $pos, $signature);
2611 $pos = $this->_putShort($data, $pos, $type);
2615 $pos = $this->_putByte($data, $pos, $len);
2616 $pos = $this->_putString($data, $pos, $header);
2618 $pos = $this->_putByte($data, $pos, 0);
2622 $pos = $this->_putLong($data, $pos, $len);
2623 $pos = $this->_putString($data, $pos, $value);
2625 $pos = $this->_putByte($data, $pos, 0);
2627 return $pos;
2633 $pos = 0;
2652 $pos = $this->_writeIPTCEntry($data, $pos, $type, $value[$i]);
2656 $pos = $this->_writeIPTCEntry($data, $pos, $type, $value);
2668 * @param integer $pos
2675 function _writeIPTCEntry(&$data, $pos, $type, &$value) {
2676 $pos = $this->_putShort($data, $pos, 0x1C02);
2677 $pos = $this->_putByte($data, $pos, $type);
2678 $pos = $this->_putShort($data, $pos, strlen($value));
2679 $pos = $this->_putString($data, $pos, $value);
2681 return $pos;
3038 * @param integer $pos
3042 function _getByte(&$data, $pos) {
3043 if (!isset($data[$pos])) {
3044 throw new Exception("Requested byte at ".$pos.". Reading outside of file's boundaries.");
3047 return ord($data[$pos]);
3054 * @param integer $pos
3060 function _putByte(&$data, $pos, $val) {
3063 $data[$pos] = chr($val);
3065 return $pos + 1;
3069 function _getShort(&$data, $pos, $bigEndian = true) {
3070 if (!isset($data[$pos]) || !isset($data[$pos + 1])) {
3071 throw new Exception("Requested short at ".$pos.". Reading outside of file's boundaries.");
3075 return (ord($data[$pos]) << 8)
3076 + ord($data[$pos + 1]);
3078 return ord($data[$pos])
3079 + (ord($data[$pos + 1]) << 8);
3084 function _putShort(&$data, $pos = 0, $val = 0, $bigEndian = true) {
3088 $data[$pos + 0] = chr(($val & 0x0000FF00) >> 8);
3089 $data[$pos + 1] = chr(($val & 0x000000FF) >> 0);
3091 $data[$pos + 0] = chr(($val & 0x00FF) >> 0);
3092 $data[$pos + 1] = chr(($val & 0xFF00) >> 8);
3095 return $pos + 2;
3102 * @param integer $pos
3108 function _getLong(&$data, $pos, $bigEndian = true) {
3110 if (!isset($data[$pos]) || !isset($data[$pos + 3])){
3111 throw new Exception("Requested long at ".$pos.". Reading outside of file's boundaries.");
3114 return (ord($data[$pos]) << 24)
3115 + (ord($data[$pos + 1]) << 16)
3116 + (ord($data[$pos + 2]) << 8)
3117 + ord($data[$pos + 3]);
3119 return ord($data[$pos])
3120 + (ord($data[$pos + 1]) << 8)
3121 + (ord($data[$pos + 2]) << 16)
3122 + (ord($data[$pos + 3]) << 24);
3130 * @param integer $pos
3137 function _putLong(&$data, $pos, $val, $bigEndian = true) {
3141 $data[$pos + 0] = chr(($val & 0xFF000000) >> 24);
3142 $data[$pos + 1] = chr(($val & 0x00FF0000) >> 16);
3143 $data[$pos + 2] = chr(($val & 0x0000FF00) >> 8);
3144 $data[$pos + 3] = chr(($val & 0x000000FF) >> 0);
3146 $data[$pos + 0] = chr(($val & 0x000000FF) >> 0);
3147 $data[$pos + 1] = chr(($val & 0x0000FF00) >> 8);
3148 $data[$pos + 2] = chr(($val & 0x00FF0000) >> 16);
3149 $data[$pos + 3] = chr(($val & 0xFF000000) >> 24);
3152 return $pos + 4;
3156 function & _getNullString(&$data, $pos) {
3160 while ($pos < $max) {
3161 if (!isset($data[$pos])) {
3162 throw new Exception("Requested null-terminated string at offset ".$pos.". File terminated before the null-byte.");
3164 if (ord($data[$pos]) == 0) {
3167 $str .= $data[$pos];
3169 $pos++;
3176 function & _getFixedString(&$data, $pos, $length = -1) {
3178 $length = strlen($data) - $pos;
3181 $rv = substr($data, $pos, $length);
3185 $this->_fileName, strlen($rv), $length, $pos
3192 function _putString(&$data, $pos, &$str) {
3195 $data[$pos + $i] = $str[$i];
3198 return $pos + $len;