Lines Matching refs:stream

99 static struct gfxinfo *php_handle_gif (php_stream * stream)  in php_handle_gif()  argument
104 if (php_stream_seek(stream, 3, SEEK_CUR)) in php_handle_gif()
107 if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) in php_handle_gif()
121 static struct gfxinfo *php_handle_psd (php_stream * stream) in php_handle_psd() argument
126 if (php_stream_seek(stream, 11, SEEK_CUR)) in php_handle_psd()
129 if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) in php_handle_psd()
141 static struct gfxinfo *php_handle_bmp (php_stream * stream) in php_handle_bmp() argument
147 if (php_stream_seek(stream, 11, SEEK_CUR)) in php_handle_bmp()
150 if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) in php_handle_bmp()
191 static struct gfxinfo *php_handle_swc(php_stream * stream) in php_handle_swc() argument
203 if (php_stream_seek(stream, 5, SEEK_CUR)) { in php_handle_swc()
207 if (php_stream_read(stream, (char *) a, sizeof(a)) != sizeof(a)) { in php_handle_swc()
215 if (php_stream_seek(stream, 8, SEEK_SET)) { in php_handle_swc()
220 bufz = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0); in php_handle_swc()
272 static struct gfxinfo *php_handle_swf (php_stream * stream) in php_handle_swf() argument
278 if (php_stream_seek(stream, 5, SEEK_CUR)) in php_handle_swf()
281 if (php_stream_read(stream, (char*)a, sizeof(a)) != sizeof(a)) in php_handle_swf()
298 static struct gfxinfo *php_handle_png (php_stream * stream) in php_handle_png() argument
311 if (php_stream_seek(stream, 8, SEEK_CUR)) in php_handle_png()
314 if((php_stream_read(stream, (char*)dim, sizeof(dim))) < sizeof(dim)) in php_handle_png()
365 static unsigned short php_read2(php_stream * stream) in php_read2() argument
370 if((php_stream_read(stream, (char *) a, sizeof(a))) < sizeof(a)) return 0; in php_read2()
378 static unsigned int php_next_marker(php_stream * stream, int last_marker, int ff_read) in php_next_marker() argument
386 while ((marker = php_stream_getc(stream)) != 0xff) { in php_next_marker()
398 if ((marker = php_stream_getc(stream)) == EOF) in php_next_marker()
414 static int php_skip_variable(php_stream * stream) in php_skip_variable() argument
416 zend_off_t length = ((unsigned int)php_read2(stream)); in php_skip_variable()
422 php_stream_seek(stream, (zend_long)length, SEEK_CUR); in php_skip_variable()
428 static int php_read_APP(php_stream * stream, unsigned int marker, zval *info) in php_read_APP() argument
435 length = php_read2(stream); in php_read_APP()
443 if (php_stream_read(stream, buffer, (size_t) length) != length) { in php_read_APP()
462 static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info) in php_handle_jpeg() argument
469 marker = php_next_marker(stream, marker, ff_read); in php_handle_jpeg()
488 length = php_read2(stream); in php_handle_jpeg()
489 result->bits = php_stream_getc(stream); in php_handle_jpeg()
490 result->height = php_read2(stream); in php_handle_jpeg()
491 result->width = php_read2(stream); in php_handle_jpeg()
492 result->channels = php_stream_getc(stream); in php_handle_jpeg()
496 if (php_stream_seek(stream, length - 8, SEEK_CUR)) { /* file error after info */ in php_handle_jpeg()
500 if (!php_skip_variable(stream)) { in php_handle_jpeg()
523 if (!php_read_APP(stream, marker, info)) { /* read all the app marks... */ in php_handle_jpeg()
527 if (!php_skip_variable(stream)) { in php_handle_jpeg()
538 if (!php_skip_variable(stream)) { /* anything else isn't interesting */ in php_handle_jpeg()
550 static unsigned int php_read4(php_stream * stream) in php_read4() argument
555 if ((php_stream_read(stream, (char*)a, sizeof(a))) != sizeof(a)) return 0; in php_read4()
590 static struct gfxinfo *php_handle_jpc(php_stream * stream) in php_handle_jpc() argument
605 first_marker_id = php_stream_getc(stream); in php_handle_jpc()
615 php_read2(stream); /* Lsiz */ in php_handle_jpc()
616 php_read2(stream); /* Rsiz */ in php_handle_jpc()
617 result->width = php_read4(stream); /* Xsiz */ in php_handle_jpc()
618 result->height = php_read4(stream); /* Ysiz */ in php_handle_jpc()
621 php_read4(stream); /* XOsiz */ in php_handle_jpc()
622 php_read4(stream); /* YOsiz */ in php_handle_jpc()
623 php_read4(stream); /* XTsiz */ in php_handle_jpc()
624 php_read4(stream); /* YTsiz */ in php_handle_jpc()
625 php_read4(stream); /* XTOsiz */ in php_handle_jpc()
626 php_read4(stream); /* YTOsiz */ in php_handle_jpc()
628 if (php_stream_seek(stream, 24, SEEK_CUR)) { in php_handle_jpc()
634 result->channels = php_read2(stream); /* Csiz */ in php_handle_jpc()
635 if ((result->channels == 0 && php_stream_eof(stream)) || result->channels > 256) { in php_handle_jpc()
643 bit_depth = php_stream_getc(stream); /* Ssiz[i] */ in php_handle_jpc()
649 php_stream_getc(stream); /* XRsiz[i] */ in php_handle_jpc()
650 php_stream_getc(stream); /* YRsiz[i] */ in php_handle_jpc()
661 static struct gfxinfo *php_handle_jp2(php_stream *stream) in php_handle_jp2() argument
679 box_length = php_read4(stream); /* LBox */ in php_handle_jp2()
681 if (php_stream_read(stream, (void *)&box_type, sizeof(box_type)) != sizeof(box_type)) { in php_handle_jp2()
694 php_stream_seek(stream, 3, SEEK_CUR); in php_handle_jp2()
696 result = php_handle_jpc(stream); in php_handle_jp2()
706 if (php_stream_seek(stream, box_length - 8, SEEK_CUR)) { in php_handle_jp2()
787 static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int motorola_intel) in php_handle_tiff() argument
796 if (php_stream_read(stream, ifd_ptr, 4) != 4) in php_handle_tiff()
799 if (php_stream_seek(stream, ifd_addr-8, SEEK_CUR)) in php_handle_tiff()
803 if (php_stream_read(stream, ifd_data, 2) != 2) { in php_handle_tiff()
811 if (php_stream_read(stream, ifd_data+2, dir_size-2) != dir_size-2) { in php_handle_tiff()
867 static struct gfxinfo *php_handle_iff(php_stream * stream) in php_handle_iff() argument
875 if (php_stream_read(stream, (char *) a, 8) != 8) { in php_handle_iff()
884 if (php_stream_read(stream, (char*)a, 8) != 8) { in php_handle_iff()
896 if (size < 9 || php_stream_read(stream, (char*)a, 9) != 9) { in php_handle_iff()
911 if (php_stream_seek(stream, size, SEEK_CUR)) { in php_handle_iff()
928 static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check) in php_get_wbmp() argument
932 if (php_stream_rewind(stream)) { in php_get_wbmp()
937 if (php_stream_getc(stream) != 0) { in php_get_wbmp()
943 i = php_stream_getc(stream); in php_get_wbmp()
951 i = php_stream_getc(stream); in php_get_wbmp()
964 i = php_stream_getc(stream); in php_get_wbmp()
989 static struct gfxinfo *php_handle_wbmp(php_stream * stream) in php_handle_wbmp() argument
993 if (!php_get_wbmp(stream, &result, 0)) { in php_handle_wbmp()
1003 static int php_get_xbm(php_stream *stream, struct gfxinfo **result) in php_get_xbm() argument
1014 if (php_stream_rewind(stream)) { in php_get_xbm()
1017 while ((fline=php_stream_gets(stream, NULL, 0)) != NULL) { in php_get_xbm()
1062 static struct gfxinfo *php_handle_xbm(php_stream * stream) in php_handle_xbm() argument
1065 php_get_xbm(stream, &result); in php_handle_xbm()
1071 static struct gfxinfo *php_handle_ico(php_stream * stream) in php_handle_ico() argument
1077 if (php_stream_read(stream, (char *) dim, 2) != 2) in php_handle_ico()
1089 if (php_stream_read(stream, (char *) dim, sizeof(dim)) != sizeof(dim)) in php_handle_ico()
1112 static struct gfxinfo *php_handle_webp(php_stream * stream) in php_handle_webp() argument
1119 if (php_stream_read(stream, (char *) buf, 18) != 18) in php_handle_webp()
1286 PHPAPI int php_getimagetype(php_stream * stream, const char *input, char *filetype) in php_getimagetype() argument
1292 if((php_stream_read(stream, filetype, 3)) != 3) { in php_getimagetype()
1303 if (php_stream_read(stream, filetype+3, 5) != 5) { in php_getimagetype()
1324 if (php_stream_read(stream, filetype+3, 9) != 9) { in php_getimagetype()
1335 if (php_stream_read(stream, filetype+3, 1) != 1) { in php_getimagetype()
1351 twelve_bytes_read = (php_stream_read(stream, filetype+4, 8) == 8); in php_getimagetype()
1359 if (php_get_wbmp(stream, NULL, 1)) { in php_getimagetype()
1366 if (php_get_xbm(stream, NULL)) { in php_getimagetype()
1373 static void php_getimagesize_from_stream(php_stream *stream, char *input, zval *info, INTERNAL_FUNC… in php_getimagesize_from_stream() argument
1378 if (!stream) { in php_getimagesize_from_stream()
1382 itype = php_getimagetype(stream, input, NULL); in php_getimagesize_from_stream()
1385 result = php_handle_gif(stream); in php_getimagesize_from_stream()
1389 result = php_handle_jpeg(stream, info); in php_getimagesize_from_stream()
1391 result = php_handle_jpeg(stream, NULL); in php_getimagesize_from_stream()
1395 result = php_handle_png(stream); in php_getimagesize_from_stream()
1398 result = php_handle_swf(stream); in php_getimagesize_from_stream()
1402 result = php_handle_swc(stream); in php_getimagesize_from_stream()
1408 result = php_handle_psd(stream); in php_getimagesize_from_stream()
1411 result = php_handle_bmp(stream); in php_getimagesize_from_stream()
1414 result = php_handle_tiff(stream, NULL, 0); in php_getimagesize_from_stream()
1417 result = php_handle_tiff(stream, NULL, 1); in php_getimagesize_from_stream()
1420 result = php_handle_jpc(stream); in php_getimagesize_from_stream()
1423 result = php_handle_jp2(stream); in php_getimagesize_from_stream()
1426 result = php_handle_iff(stream); in php_getimagesize_from_stream()
1429 result = php_handle_wbmp(stream); in php_getimagesize_from_stream()
1432 result = php_handle_xbm(stream); in php_getimagesize_from_stream()
1435 result = php_handle_ico(stream); in php_getimagesize_from_stream()
1438 result = php_handle_webp(stream); in php_getimagesize_from_stream()
1473 php_stream *stream = NULL; in php_getimagesize_from_any() local
1497 stream = php_stream_open_wrapper(input, "rb", STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH, NULL); in php_getimagesize_from_any()
1499 stream = php_stream_memory_open(TEMP_STREAM_READONLY, input, input_len); in php_getimagesize_from_any()
1502 if (!stream) { in php_getimagesize_from_any()
1506 php_getimagesize_from_stream(stream, input, info, INTERNAL_FUNCTION_PARAM_PASSTHRU); in php_getimagesize_from_any()
1507 php_stream_close(stream); in php_getimagesize_from_any()