Lines Matching defs:data

900         $data = null;
913 $data =& $this->_info['exif']['JFIFThumbnail'];
918 if (($which == 'adobe') || ($data == null)){
929 $data =& $this->_info['adobe']['ThumbnailData'];
934 if ($data != null) {
936 echo $data;
1033 return false; // ERROR: Extraneous data
1041 return false; // ERROR: Extraneous data
1050 case 0xE0: // APP0: JFIF data
1051 case 0xE1: // APP1: EXIF or XMP data
1052 case 0xED: // APP13: IPTC / Photoshop data
1057 $length = -1; // This field has no length... it includes all data until EOF
1071 $this->_markers[$count]['data'] = fread($this->_fp, $length);
1073 $this->_markers[$count]['data'] = "";
1194 break; // ERROR: Extraneous data
1204 break; // ERROR: Extraneous data
1208 unset($data);
1209 if ($marker == 0xE1) { // APP1: EXIF data
1210 $data =& $this->_createMarkerEXIF();
1213 elseif ($marker == 0xED) { // APP13: IPTC / Photoshop data
1214 $data =& $this->_createMarkerAdobe();
1241 if (isset($data)) {
1242 $length = strlen($data);
1246 $this->_writeJPEGMarker($marker, $length, $data, $origLength);
1268 * @param string $data
1273 function _writeJPEGMarker($marker, $length, &$data, $origLength) {
1283 if (isset($data)) {
1284 // Copy the generated data
1285 fputs($this->_fpout, $data, $length);
1287 if ($origLength > 0) { // Skip the original data
1299 $data = fread($this->_fp, 1024 * 16);
1300 fputs($this->_fpout, $data, strlen($data));
1303 $data = @fread($this->_fp, $length);
1304 fputs($this->_fpout, $data, $length);
1431 $data = null;
1435 $signature = $this->_getFixedString($this->_markers[$i]['data'], 0, 4);
1437 $data =& $this->_markers[$i]['data'];
1443 if ($data == null) {
1450 $vmaj = $this->_getByte($data, 5);
1451 $vmin = $this->_getByte($data, 6);
1455 $units = $this->_getByte($data, 7);
1471 $xdens = $this->_getShort($data, 8);
1472 $ydens = $this->_getShort($data, 10);
1477 $thumbx = $this->_getByte($data, 12);
1478 $thumby = $this->_getByte($data, 13);
1502 $data = null;
1510 $data =& $this->_markers[$i]['data'];
1516 if ($data == null) {
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);
1556 * Parses the XMP data
1570 $data = null;
1574 $signature = $this->_getFixedString($this->_markers[$i]['data'], 0, 29);
1576 $data = substr($this->_markers[$i]['data'], 29);
1582 if ($data == null) {
1590 $result = xml_parse_into_struct($parser, $data, $values, $tags);
1677 $data = null;
1681 $signature = $this->_getFixedString($this->_markers[$i]['data'], 0, 6);
1683 $data =& $this->_markers[$i]['data'];
1689 if ($data == null) {
1698 $byteAlign = $this->_getShort($data, $pos + 0);
1705 return false; // Unexpected data
1708 $alignCheck = $this->_getShort($data, $pos + 2, $isBigEndian);
1710 return false; // Unexpected data
1718 $offsetIFD0 = $this->_getLong($data, $pos + 4, $isBigEndian);
1720 return false; // Unexpected data
1722 $offsetIFD1 = $this->_readIFD($data, $pos, $offsetIFD0, $isBigEndian, 'ifd0');
1724 $this->_readIFD($data, $pos, $offsetIFD1, $isBigEndian, 'ifd1');
1737 * @param mixed $data
1745 function _readIFD($data, $base, $offset, $isBigEndian, $mode) {
1748 $numEntries = $this->_getShort($data, $base + $offset, $isBigEndian);
1757 $tag = $this->_getShort($data, $base + $offset, $isBigEndian);
1759 $type = $this->_getShort($data, $base + $offset, $isBigEndian);
1761 $count = $this->_getLong($data, $base + $offset, $isBigEndian);
1771 $dataOffset = $this->_getLong($data, $base + $offset, $isBigEndian);
1772 $rawValue = $this->_getFixedString($data, $base + $dataOffset, $dataLength);
1774 $rawValue = $this->_getFixedString($data, $base + $offset, $dataLength);
1901 $this->_readIFD($data, $base, $value, $isBigEndian, 'exif');
1903 $this->_readIFD($data, $base, $value, $isBigEndian, 'gps');
1913 $this->_readIFD($data, $base, $value, $isBigEndian, 'interop');
1937 // and saving it without saving the data it points to might
1945 $this->_info['exif']['JFIFThumbnail'] = $this->_getFixedString($data, $base + $exifThumbnailOffset, $exifThumbnailLength);
1949 $this->_info['exif']['TIFFStrips'] = $this->_getFixedString($data, $base + $exifTIFFOffset, $exifTIFFLength);
1952 $nextOffset = $this->_getLong($data, $base + $offset, $isBigEndian);
1958 $data = null;
1962 $signature = $this->_getFixedString($this->_markers[$i]['data'], 0, 6);
1964 $data =& $this->_markers[$i]['data'];
1974 $data = "Exif\0\0";
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);
1996 return $data;
2002 * @param mixed $data
2011 function _writeIFD(&$data, $pos, $offsetBase, &$entries, $isBigEndian, $hasNext) {
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);
2030 $dataPos = $this->_writeIFD($data, $dataPos, $offsetBase, $entries[$i]['value'], $isBigEndian, false);
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
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);
2044 $dataPos = $this->_putString($data, $dataPos, $entries[$i]['value']);
2047 $pos = $this->_putString($data, $pos, $val);
2053 $this->_putLong($data, $tiffDataOffsetPos, $dataPos - $offsetBase, $isBigEndian);
2054 $dataPos = $this->_putString($data, $dataPos, $tiffData);
2058 $pos = $this->_putLong($data, $pos, $dataPos - $offsetBase, $isBigEndian);
2060 $pos = $this->_putLong($data, $pos, 0, $isBigEndian);
2420 $data = null;
2424 $signature = $this->_getFixedString($this->_markers[$i]['data'], 0, 14);
2426 $data =& $this->_markers[$i]['data'];
2432 if ($data == null) {
2442 $datasize = strlen($data);
2445 $signature = $this->_getFixedString($data, $pos, 4);
2450 $type = $this->_getShort($data, $pos);
2453 $strlen = $this->_getByte($data, $pos);
2457 $header .= $data[$pos + $i];
2461 $length = $this->_getLong($data, $pos);
2468 $pos = $this->_readIPTC($data, $pos);
2473 $this->_info['adobe']['CopyrightFlag'] = $this->_getByte($data, $pos);
2477 $this->_info['adobe']['ImageURL'] = $this->_getFixedString($data, $pos, $length);
2481 $aux = $this->_getLong($data, $pos);
2484 $this->_info['adobe']['ThumbnailWidth'] = $this->_getLong($data, $pos);
2486 $this->_info['adobe']['ThumbnailHeight'] = $this->_getLong($data, $pos);
2489 $pos += 16; // Skip some data
2491 $this->_info['adobe']['ThumbnailData'] = $this->_getFixedString($data, $pos, $length - 28);
2504 $this->_info['adobe']['raw'][$label]['data'] =& $this->_getFixedString($data, $basePos, $length);
2517 function _readIPTC(&$data, $pos = 0) {
2518 $totalLength = strlen($data);
2523 $signature = $this->_getShort($data, $pos);
2528 $type = $this->_getByte($data, $pos);
2530 $length = $this->_getShort($data, $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);
2574 $this->_info['adobe']['raw']['8BIM_0x0404']['data'] =& $this->_writeIPTC();
2578 $data = "Photoshop 3.0\0";
2584 $data,
2588 $value['data'] );
2592 return $data;
2598 * @param mixed $data
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);
2632 $data = " ";
2652 $pos = $this->_writeIPTCEntry($data, $pos, $type, $value[$i]);
2656 $pos = $this->_writeIPTCEntry($data, $pos, $type, $value);
2661 return $data;
2667 * @param mixed $data
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);
3037 * @param $data
3042 function _getByte(&$data, $pos) {
3043 if (!isset($data[$pos])) {
3047 return ord($data[$pos]);
3053 * @param mixed $data
3060 function _putByte(&$data, $pos, $val) {
3063 $data[$pos] = chr($val);
3069 function _getShort(&$data, $pos, $bigEndian = true) {
3070 if (!isset($data[$pos]) || !isset($data[$pos + 1])) {
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);
3101 * @param mixed $data
3108 function _getLong(&$data, $pos, $bigEndian = true) {
3110 if (!isset($data[$pos]) || !isset($data[$pos + 3])){
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);
3129 * @param mixed $data
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);
3156 function & _getNullString(&$data, $pos) {
3158 $max = strlen($data);
3161 if (!isset($data[$pos])) {
3164 if (ord($data[$pos]) == 0) {
3167 $str .= $data[$pos];
3176 function & _getFixedString(&$data, $pos, $length = -1) {
3178 $length = strlen($data) - $pos;
3181 $rv = substr($data, $pos, $length);
3192 function _putString(&$data, $pos, &$str) {
3195 $data[$pos + $i] = $str[$i];
3202 function _hexDump(&$data, $start = 0, $length = -1) {
3203 if (($length == -1) || (($length + $start) > strlen($data))) {
3204 $end = strlen($data);
3219 $c = ord($data[$start]);