Lines Matching refs:stream

103 static struct gfxinfo *php_handle_gif (php_stream * stream)  in php_handle_gif()  argument
108 if (php_stream_seek(stream, 3, SEEK_CUR)) in php_handle_gif()
111 if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) in php_handle_gif()
126 static struct gfxinfo *php_handle_psd (php_stream * stream) in php_handle_psd() argument
131 if (php_stream_seek(stream, 11, SEEK_CUR)) in php_handle_psd()
134 if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) in php_handle_psd()
147 static struct gfxinfo *php_handle_bmp (php_stream * stream) in php_handle_bmp() argument
153 if (php_stream_seek(stream, 11, SEEK_CUR)) in php_handle_bmp()
156 if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) in php_handle_bmp()
198 static struct gfxinfo *php_handle_swc(php_stream * stream) in php_handle_swc() argument
212 if (php_stream_seek(stream, 5, SEEK_CUR)) in php_handle_swc()
215 if (php_stream_read(stream, (char *) a, sizeof(a)) != sizeof(a)) in php_handle_swc()
220 if (php_stream_seek(stream, 8, SEEK_SET)) { in php_handle_swc()
224 bufz = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0); in php_handle_swc()
276 static struct gfxinfo *php_handle_swf (php_stream * stream) in php_handle_swf() argument
282 if (php_stream_seek(stream, 5, SEEK_CUR)) in php_handle_swf()
285 if (php_stream_read(stream, (char*)a, sizeof(a)) != sizeof(a)) in php_handle_swf()
302 static struct gfxinfo *php_handle_png (php_stream * stream) in php_handle_png() argument
315 if (php_stream_seek(stream, 8, SEEK_CUR)) in php_handle_png()
318 if((php_stream_read(stream, (char*)dim, sizeof(dim))) < sizeof(dim)) in php_handle_png()
370 static unsigned short php_read2(php_stream * stream) in php_read2() argument
375 if((php_stream_read(stream, (char *) a, sizeof(a))) < sizeof(a)) return 0; in php_read2()
383 static unsigned int php_next_marker(php_stream * stream, int last_marker, int ff_read) in php_next_marker() argument
391 while ((marker = php_stream_getc(stream)) != 0xff) { in php_next_marker()
403 if ((marker = php_stream_getc(stream)) == EOF) in php_next_marker()
419 static int php_skip_variable(php_stream * stream) in php_skip_variable() argument
421 zend_off_t length = ((unsigned int)php_read2(stream)); in php_skip_variable()
427 php_stream_seek(stream, (zend_long)length, SEEK_CUR); in php_skip_variable()
434 static int php_read_APP(php_stream * stream, unsigned int marker, zval *info) in php_read_APP() argument
441 length = php_read2(stream); in php_read_APP()
449 if (php_stream_read(stream, buffer, (zend_long) length) <= 0) { in php_read_APP()
468 static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info) in php_handle_jpeg() argument
475 marker = php_next_marker(stream, marker, ff_read); in php_handle_jpeg()
494 length = php_read2(stream); in php_handle_jpeg()
495 result->bits = php_stream_getc(stream); in php_handle_jpeg()
496 result->height = php_read2(stream); in php_handle_jpeg()
497 result->width = php_read2(stream); in php_handle_jpeg()
498 result->channels = php_stream_getc(stream); in php_handle_jpeg()
502 if (php_stream_seek(stream, length - 8, SEEK_CUR)) { /* file error after info */ in php_handle_jpeg()
506 if (!php_skip_variable(stream)) { in php_handle_jpeg()
529 if (!php_read_APP(stream, marker, info)) { /* read all the app marks... */ in php_handle_jpeg()
533 if (!php_skip_variable(stream)) { in php_handle_jpeg()
544 if (!php_skip_variable(stream)) { /* anything else isn't interesting */ in php_handle_jpeg()
557 static unsigned int php_read4(php_stream * stream) in php_read4() argument
562 if ((php_stream_read(stream, (char*)a, sizeof(a))) != sizeof(a)) return 0; in php_read4()
597 static struct gfxinfo *php_handle_jpc(php_stream * stream) in php_handle_jpc() argument
612 first_marker_id = php_stream_getc(stream); in php_handle_jpc()
622 php_read2(stream); /* Lsiz */ in php_handle_jpc()
623 php_read2(stream); /* Rsiz */ in php_handle_jpc()
624 result->width = php_read4(stream); /* Xsiz */ in php_handle_jpc()
625 result->height = php_read4(stream); /* Ysiz */ in php_handle_jpc()
628 php_read4(stream); /* XOsiz */ in php_handle_jpc()
629 php_read4(stream); /* YOsiz */ in php_handle_jpc()
630 php_read4(stream); /* XTsiz */ in php_handle_jpc()
631 php_read4(stream); /* YTsiz */ in php_handle_jpc()
632 php_read4(stream); /* XTOsiz */ in php_handle_jpc()
633 php_read4(stream); /* YTOsiz */ in php_handle_jpc()
635 if (php_stream_seek(stream, 24, SEEK_CUR)) { in php_handle_jpc()
641 result->channels = php_read2(stream); /* Csiz */ in php_handle_jpc()
642 if ((result->channels == 0 && php_stream_eof(stream)) || result->channels > 256) { in php_handle_jpc()
650 bit_depth = php_stream_getc(stream); /* Ssiz[i] */ in php_handle_jpc()
656 php_stream_getc(stream); /* XRsiz[i] */ in php_handle_jpc()
657 php_stream_getc(stream); /* YRsiz[i] */ in php_handle_jpc()
668 static struct gfxinfo *php_handle_jp2(php_stream *stream) in php_handle_jp2() argument
686 box_length = php_read4(stream); /* LBox */ in php_handle_jp2()
688 if (php_stream_read(stream, (void *)&box_type, sizeof(box_type)) != sizeof(box_type)) { in php_handle_jp2()
701 php_stream_seek(stream, 3, SEEK_CUR); in php_handle_jp2()
703 result = php_handle_jpc(stream); in php_handle_jp2()
713 if (php_stream_seek(stream, box_length - 8, SEEK_CUR)) { in php_handle_jp2()
795 static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int motorola_intel) in php_handle_tiff() argument
804 if (php_stream_read(stream, ifd_ptr, 4) != 4) in php_handle_tiff()
807 if (php_stream_seek(stream, ifd_addr-8, SEEK_CUR)) in php_handle_tiff()
811 if (php_stream_read(stream, ifd_data, 2) != 2) { in php_handle_tiff()
819 if (php_stream_read(stream, ifd_data+2, dir_size-2) != dir_size-2) { in php_handle_tiff()
876 static struct gfxinfo *php_handle_iff(php_stream * stream) in php_handle_iff() argument
884 if (php_stream_read(stream, (char *) a, 8) != 8) { in php_handle_iff()
893 if (php_stream_read(stream, (char*)a, 8) != 8) { in php_handle_iff()
905 if (size < 9 || php_stream_read(stream, (char*)a, 9) != 9) { in php_handle_iff()
920 if (php_stream_seek(stream, size, SEEK_CUR)) { in php_handle_iff()
937 static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check) in php_get_wbmp() argument
941 if (php_stream_rewind(stream)) { in php_get_wbmp()
946 if (php_stream_getc(stream) != 0) { in php_get_wbmp()
952 i = php_stream_getc(stream); in php_get_wbmp()
960 i = php_stream_getc(stream); in php_get_wbmp()
973 i = php_stream_getc(stream); in php_get_wbmp()
999 static struct gfxinfo *php_handle_wbmp(php_stream * stream) in php_handle_wbmp() argument
1003 if (!php_get_wbmp(stream, &result, 0)) { in php_handle_wbmp()
1014 static int php_get_xbm(php_stream *stream, struct gfxinfo **result) in php_get_xbm() argument
1025 if (php_stream_rewind(stream)) { in php_get_xbm()
1028 while ((fline=php_stream_gets(stream, NULL, 0)) != NULL) { in php_get_xbm()
1074 static struct gfxinfo *php_handle_xbm(php_stream * stream) in php_handle_xbm() argument
1077 php_get_xbm(stream, &result); in php_handle_xbm()
1084 static struct gfxinfo *php_handle_ico(php_stream * stream) in php_handle_ico() argument
1090 if (php_stream_read(stream, (char *) dim, 2) != 2) in php_handle_ico()
1102 if (php_stream_read(stream, (char *) dim, sizeof(dim)) != sizeof(dim)) in php_handle_ico()
1223 PHPAPI int php_getimagetype(php_stream * stream, char *filetype) in php_getimagetype() argument
1229 if((php_stream_read(stream, filetype, 3)) != 3) { in php_getimagetype()
1240 if (php_stream_read(stream, filetype+3, 5) != 5) { in php_getimagetype()
1262 if (php_stream_read(stream, filetype+3, 1) != 1) { in php_getimagetype()
1278 twelve_bytes_read = (php_stream_read(stream, filetype+4, 8) == 8); in php_getimagetype()
1286 if (php_get_wbmp(stream, NULL, 1)) { in php_getimagetype()
1293 if (php_get_xbm(stream, NULL)) { in php_getimagetype()
1300 static void php_getimagesize_from_stream(php_stream *stream, zval *info, INTERNAL_FUNCTION_PARAMETE… in php_getimagesize_from_stream() argument
1305 if (!stream) { in php_getimagesize_from_stream()
1309 itype = php_getimagetype(stream, NULL); in php_getimagesize_from_stream()
1312 result = php_handle_gif(stream); in php_getimagesize_from_stream()
1316 result = php_handle_jpeg(stream, info); in php_getimagesize_from_stream()
1318 result = php_handle_jpeg(stream, NULL); in php_getimagesize_from_stream()
1322 result = php_handle_png(stream); in php_getimagesize_from_stream()
1325 result = php_handle_swf(stream); in php_getimagesize_from_stream()
1329 result = php_handle_swc(stream); in php_getimagesize_from_stream()
1335 result = php_handle_psd(stream); in php_getimagesize_from_stream()
1338 result = php_handle_bmp(stream); in php_getimagesize_from_stream()
1341 result = php_handle_tiff(stream, NULL, 0); in php_getimagesize_from_stream()
1344 result = php_handle_tiff(stream, NULL, 1); in php_getimagesize_from_stream()
1347 result = php_handle_jpc(stream); in php_getimagesize_from_stream()
1350 result = php_handle_jp2(stream); in php_getimagesize_from_stream()
1353 result = php_handle_iff(stream); in php_getimagesize_from_stream()
1356 result = php_handle_wbmp(stream); in php_getimagesize_from_stream()
1359 result = php_handle_xbm(stream); in php_getimagesize_from_stream()
1362 result = php_handle_ico(stream); in php_getimagesize_from_stream()
1397 php_stream *stream = NULL; in php_getimagesize_from_any() local
1412 stream = php_stream_open_wrapper(input, "rb", STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH, NULL); in php_getimagesize_from_any()
1414 stream = php_stream_memory_open(TEMP_STREAM_READONLY, input, input_len); in php_getimagesize_from_any()
1417 if (!stream) { in php_getimagesize_from_any()
1421 php_getimagesize_from_stream(stream, info, INTERNAL_FUNCTION_PARAM_PASSTHRU); in php_getimagesize_from_any()
1422 php_stream_close(stream); in php_getimagesize_from_any()