Lines Matching refs:data

162 		$data = '';
168 $data = $this->mpdf->imageVars[$v[1]];
169 $file = md5($data);
172 if (preg_match('/data:image\/(gif|jpe?g|png|webp);base64,(.*)/', $file, $v)) {
174 $data = base64_decode($v[2]);
175 $file = md5($data);
179 if ($firsttime && $file && strpos($file, 'data:') !== 0) {
184 if (strpos($orig_srcpath, 'data:') !== 0) {
215 if (empty($data)) {
217 $data = '';
223 $data = file_get_contents($file);
224 $type = $this->guesser->guess($data);
227 if ($file && !$data && $check = @fopen($file, 'rb')) {
230 $data = file_get_contents($file);
231 $type = $this->guesser->guess($data);
234 if ((!$data || !$type) && function_exists('curl_init')) { // mPDF 5.7.4
235 $data = $this->remoteContentFetcher->getFileContentsByCurl($file); // needs full url?? even on local (never needed for local)
236 if ($data) {
237 $type = $this->guesser->guess($data);
241 if ((!$data || !$type) && !ini_get('allow_url_fopen')) { // only worth trying if remote file and !ini_get('allow_url_fopen')
242 $data = $this->remoteContentFetcher->getFileContentsBySocket($file); // needs full url?? even on local (never needed for local)
243 if ($data) {
244 $type = $this->guesser->guess($data);
249 if (!$data) {
254 $type = $this->guesser->guess($data);
267 $info = $svg->ImageSVG($data);
284 $im = @imagecreatefromstring($data);
299 $data = file_get_contents($tempfile);
310 $hdr = $this->jpgHeaderFromString($data);
317 $j = strpos($data, 'JFIF');
321 $unitSp = ord(substr($data, $j + 7, 1));
323 $ppUx = $this->twoBytesToInt(substr($data, $j + 8, 2)); // horizontal pixels per meter, usually set to zero
341 $im = @imagecreatefromstring($data);
371 $info = $this->convertImage($data, $a[2], 'DeviceCMYK', $a[0], $a[1], $ppUx, false);
378 $info = $this->convertImage($data, $a[2], 'DeviceGray', $a[0], $a[1], $ppUx, false);
382 //$pos = strpos($data, "\xFF\xEE\x00\x0EAdobe\0");
388 while (($pos = strpos($data, "ICC_PROFILE\0", $offset)) !== false) {
390 $length = $this->twoBytesToInt(substr($data, $pos - 2, 2)) - 16;
391 $sn = max(1, ord($data[$pos + 12]));
392 $nom = max(1, ord($data[$pos + 13]));
393 $icc[$sn - 1] = substr($data, $pos + 14, $length);
414 $info = ['w' => $a[0], 'h' => $a[1], 'cs' => $a[2], 'bpc' => $a[3], 'f' => 'DCTDecode', 'data' => $data, 'type' => 'jpg', 'ch' => $channels, 'icc' => $icc];
437 if (strpos($data, chr(137) . 'PNG' . chr(13) . chr(10) . chr(26) . chr(10)) !== 0) {
442 if (substr($data, 12, 4) !== 'IHDR') {
446 $w = $this->fourBytesToInt(substr($data, 16, 4));
447 $h = $this->fourBytesToInt(substr($data, 20, 4));
448 $bpc = ord(substr($data, 24, 1));
454 $ct = ord(substr($data, 25, 1));
477 if ($ct < 4 && strpos($data, 'tRNS') !== false) {
482 if ($ct === 3 && strpos($data, 'iCCP') !== false) {
488 if (ord(substr($data, 26, 1)) !== 0) {
492 if (ord(substr($data, 27, 1)) !== 0) {
496 if (ord(substr($data, 28, 1)) !== 0) {
500 $j = strpos($data, 'pHYs');
503 $unitSp = ord(substr($data, $j + 12, 1));
505 $ppUx = $this->fourBytesToInt(substr($data, $j + 4, 4)); // horizontal pixels per meter, usually set to zero
513 $j = strpos($data, 'gAMA');
514 if ($j && strpos($data, 'sRGB') === false) { // sRGB colorspace - overrides gAMA
515 $gAMA = $this->fourBytesToInt(substr($data, $j + 4, 4)); // Gamma value times 100000
541 //$j = strpos($data,'sRGB'); // sRGB colorspace - overrides gAMA
542 //$j = strpos($data,'cHRM'); // Chromaticity and Whitepoint
548 $info = $this->convertImage($data, $colspace, 'DeviceCMYK', $w, $h, $ppUx, $pngalpha, $gamma, $ct); // mPDF 5.7.2 Gamma correction
558 $info = $this->convertImage($data, $colspace, 'DeviceGray', $w, $h, $ppUx, $pngalpha, $gamma, $ct); // mPDF 5.7.2 Gamma correction
564 $info = $this->convertImage($data, $colspace, 'DeviceGray', $w, $h, $ppUx, $pngalpha, $gamma, $ct); // mPDF 5.7.2 Gamma correction
566 $info = $this->convertImage($data, $colspace, 'DeviceCMYK', $w, $h, $ppUx, $pngalpha, $gamma, $ct); // mPDF 5.7.2 Gamma correction
568 $info = $this->convertImage($data, $colspace, 'DeviceRGB', $w, $h, $ppUx, $pngalpha, $gamma, $ct); // mPDF 5.7.2 Gamma correction
581 $im = imagecreatefromstring($data);
606 $p = strpos($data, 'tRNS');
608 $n = $this->fourBytesToInt(substr($data, $p - 4, 4));
609 $transparency = substr($data, $p + 4, $n);
628 $p = strpos($data, 'tRNS');
631 $n = $this->fourBytesToInt(substr($data, $p - 4, 4));
632 $t = substr($data, $p + 4, $n);
675 // imagegammacorrect() removes the alpha channel data in $im - (I think this is a bug in PHP)
737 $p = strpos($data, 'iCCP');
740 $n = $this->fourBytesToInt(substr($data, ($p - 8), 4));
741 $nullsep = strpos(substr($data, $p, 80), chr(0));
742 $icc = substr($data, ($p + $nullsep + 2), ($n - ($nullsep + 2)));
803 //Scan chunks looking for palette, transparency and image data
811 $n = $this->fourBytesToInt(substr($data, $p, 4));
813 $type = substr($data, $p, 4);
817 $pal = substr($data, $p, $n);
822 $t = substr($data, $p, $n);
836 $pngdata.=substr($data, $p, $n);
840 $nullsep = strpos(substr($data, $p, 80), chr(0));
841 $icc = substr($data, $p + $nullsep + 2, $n - ($nullsep + 2));
863 return $this->imageError($file, $firsttime, 'Error parsing PNG image data');
869 return $this->imageError($file, $firsttime, 'Error parsing PNG image data - no IDAT data found');
873 return $this->imageError($file, $firsttime, 'Error parsing PNG image data - missing colour palette');
880 $info = ['w' => $w, 'h' => $h, 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'FlateDecode', 'parms' => $parms, 'pal' => $pal, 'trns' => $trns, 'data' => $pngdata, 'ch' => $channels, 'icc' => $icc];
907 $im = @imagecreatefromstring($data);
956 $gif->loadFile($data, 0);
996 $info = ['w' => $w, 'h' => $h, 'cs' => $colspace, 'bpc' => 8, 'f' => 'FlateDecode', 'pal' => $pal, 'trns' => $trns, 'data' => $gifdata];
998 $info = ['w' => $w, 'h' => $h, 'cs' => $colspace, 'bpc' => 8, 'pal' => $pal, 'trns' => $trns, 'data' => $gifdata];
1016 $info = $this->bmp->_getBMPimage($data, $file);
1035 $wmfres = $this->wmf->_getWMFimage($data);
1044 $info = ['x' => $wmfres[2][0], 'y' => $wmfres[2][1], 'w' => $wmfres[3][0], 'h' => $wmfres[3][1], 'data' => $wmfres[1]];
1059 $im = @imagecreatefromstring($data);
1100 private function convertImage(&$data, $colspace, $targetcs, $w, $h, $dpi, $mask, $gamma_correction = false, $pngcolortype = false)
1110 $im = @imagecreatefromstring($data);
1112 $bpc = ord(substr($data, 24, 1));
1120 // Need to extract alpha channel info before imagegammacorrect (which loses the data)
1126 $p = strpos($data, 'tRNS');
1128 $n = $this->fourBytesToInt(substr($data, $p - 4, 4));
1129 $transparency = substr($data, $p + 4, $n);
1146 $p = strpos($data, 'tRNS');
1149 $n = $this->fourBytesToInt(substr($data, $p - 4, 4));
1150 $t = substr($data, $p + 4, $n);
1203 $p = strpos($data, 'tRNS');
1205 $n = $this->fourBytesToInt(substr($data, ($p - 4), 4));
1206 $t = substr($data, $p + 4, $n);
1308 $info = ['w' => $w, 'h' => $h, 'cs' => $targetcs, 'bpc' => 8, 'f' => 'FlateDecode', 'data' => $imgdata, 'type' => 'png',
1315 $minfo = ['w' => $w, 'h' => $h, 'cs' => 'DeviceGray', 'bpc' => 8, 'f' => 'FlateDecode', 'data' => $mimgdata, 'type' => 'png',
1320 $tempfile = '_tempImgPNG' . md5($data) . random_int(1, 10000) . '.png';
1334 private function jpgHeaderFromString(&$data)
1337 $p += $this->twoBytesToInt(substr($data, $p, 2)); // Length of initial marker block
1338 $marker = substr($data, $p, 2);
1340 while ($marker !== chr(255) . chr(192) && $marker !== chr(255) . chr(194) && $marker !== chr(255) . chr(193) && $p < strlen($data)) {
1342 $p += $this->twoBytesToInt(substr($data, $p + 2, 2)) + 2; // Length of marker block
1343 $marker = substr($data, $p, 2);
1349 return substr($data, $p + 2, 10);
1413 private function gzCompress($data)
1419 return gzcompress($data);