ImageInfo 296 ext/exif/exif.c #define EXIF_ERRLOG_FILEEOF(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_FILEEOF); ImageInfo 297 ext/exif/exif.c #define EXIF_ERRLOG_CORRUPT(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_CORRUPT); ImageInfo 298 ext/exif/exif.c #define EXIF_ERRLOG_THUMBEOF(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_THUMBEOF); ImageInfo 299 ext/exif/exif.c #define EXIF_ERRLOG_FSREALLOC(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_FSREALLOC); ImageInfo 1558 ext/exif/exif.c static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_type *ImageInfo, int type, const char *format, ...) ImageInfo 1568 ext/exif/exif.c php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args); ImageInfo 1572 ext/exif/exif.c php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args); ImageInfo 1592 ext/exif/exif.c static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t size, uchar *data) ImageInfo 1595 ext/exif/exif.c int count = ImageInfo->file.count; ImageInfo 1597 ext/exif/exif.c tmp = safe_erealloc(ImageInfo->file.list, (count+1), sizeof(file_section), 0); ImageInfo 1598 ext/exif/exif.c ImageInfo->file.list = tmp; ImageInfo 1599 ext/exif/exif.c ImageInfo->file.list[count].type = 0xFFFF; ImageInfo 1600 ext/exif/exif.c ImageInfo->file.list[count].data = NULL; ImageInfo 1601 ext/exif/exif.c ImageInfo->file.list[count].size = 0; ImageInfo 1602 ext/exif/exif.c ImageInfo->file.count = count+1; ImageInfo 1608 ext/exif/exif.c ImageInfo->file.list[count].type = type; ImageInfo 1609 ext/exif/exif.c ImageInfo->file.list[count].data = data; ImageInfo 1610 ext/exif/exif.c ImageInfo->file.list[count].size = size; ImageInfo 1618 ext/exif/exif.c static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size) ImageInfo 1625 ext/exif/exif.c if (section_index >= ImageInfo->file.count) { ImageInfo 1626 ext/exif/exif.c EXIF_ERRLOG_FSREALLOC(ImageInfo) ImageInfo 1629 ext/exif/exif.c tmp = safe_erealloc(ImageInfo->file.list[section_index].data, 1, size, 0); ImageInfo 1630 ext/exif/exif.c ImageInfo->file.list[section_index].data = tmp; ImageInfo 1631 ext/exif/exif.c ImageInfo->file.list[section_index].size = size; ImageInfo 1639 ext/exif/exif.c static int exif_file_sections_free(image_info_type *ImageInfo) ImageInfo 1643 ext/exif/exif.c if (ImageInfo->file.count) { ImageInfo 1644 ext/exif/exif.c for (i=0; i<ImageInfo->file.count; i++) { ImageInfo 1645 ext/exif/exif.c EFREE_IF(ImageInfo->file.list[i].data); ImageInfo 1648 ext/exif/exif.c EFREE_IF(ImageInfo->file.list); ImageInfo 1649 ext/exif/exif.c ImageInfo->file.count = 0; ImageInfo 2270 ext/exif/exif.c static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index); ImageInfo 2271 ext/exif/exif.c static int exif_process_IFD_TAG( image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table); ImageInfo 2426 ext/exif/exif.c static void exif_thumbnail_build(image_info_type *ImageInfo) { ImageInfo 2437 ext/exif/exif.c if (!ImageInfo->read_thumbnail || !ImageInfo->Thumbnail.offset || !ImageInfo->Thumbnail.size) { ImageInfo 2441 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: filetype = %d", ImageInfo->Thumbnail.filetype); ImageInfo 2443 ext/exif/exif.c switch(ImageInfo->Thumbnail.filetype) { ImageInfo 2450 ext/exif/exif.c info_list = &ImageInfo->info_list[SECTION_THUMBNAIL]; ImageInfo 2453 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: size of signature + directory(%d): 0x%02X", info_list->count, new_size); ImageInfo 2464 ext/exif/exif.c new_data = safe_erealloc(ImageInfo->Thumbnail.data, 1, ImageInfo->Thumbnail.size, new_size); ImageInfo 2465 ext/exif/exif.c ImageInfo->Thumbnail.data = new_data; ImageInfo 2466 ext/exif/exif.c memmove(ImageInfo->Thumbnail.data + new_move, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); ImageInfo 2467 ext/exif/exif.c ImageInfo->Thumbnail.size += new_size; ImageInfo 2469 ext/exif/exif.c if (ImageInfo->motorola_intel) { ImageInfo 2475 ext/exif/exif.c php_ifd_set16u(new_data, info_list->count, ImageInfo->motorola_intel); ImageInfo 2481 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process tag(x%04X=%s): %s%s (%d bytes)", info_data->tag, exif_get_tagname(info_data->tag, tagname, -12, tag_table_IFD), (info_data->length>1)&&info_data->format!=TAG_FMT_UNDEFINED&&info_data->format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(info_data->format), byte_count); ImageInfo 2484 ext/exif/exif.c php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel); ImageInfo 2485 ext/exif/exif.c php_ifd_set16u(new_data + 2, TAG_FMT_ULONG, ImageInfo->motorola_intel); ImageInfo 2486 ext/exif/exif.c php_ifd_set32u(new_data + 4, 1, ImageInfo->motorola_intel); ImageInfo 2487 ext/exif/exif.c php_ifd_set32u(new_data + 8, new_move, ImageInfo->motorola_intel); ImageInfo 2489 ext/exif/exif.c php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel); ImageInfo 2490 ext/exif/exif.c php_ifd_set16u(new_data + 2, info_data->format, ImageInfo->motorola_intel); ImageInfo 2491 ext/exif/exif.c php_ifd_set32u(new_data + 4, info_data->length, ImageInfo->motorola_intel); ImageInfo 2492 ext/exif/exif.c value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel); ImageInfo 2496 ext/exif/exif.c php_ifd_set32u(new_data+8, new_value, ImageInfo->motorola_intel); ImageInfo 2498 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: writing with value offset: 0x%04X + 0x%02X", new_value, byte_count); ImageInfo 2500 ext/exif/exif.c memmove(ImageInfo->Thumbnail.data+new_value, value_ptr, byte_count); ImageInfo 2509 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: created"); ImageInfo 2518 ext/exif/exif.c static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length) { ImageInfo 2519 ext/exif/exif.c if (ImageInfo->Thumbnail.data) { ImageInfo 2520 ext/exif/exif.c exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails"); ImageInfo 2523 ext/exif/exif.c if (!ImageInfo->read_thumbnail) { ImageInfo 2527 ext/exif/exif.c if (ImageInfo->Thumbnail.size >= 65536 ImageInfo 2528 ext/exif/exif.c || ImageInfo->Thumbnail.size <= 0 ImageInfo 2529 ext/exif/exif.c || ImageInfo->Thumbnail.offset <= 0 ImageInfo 2531 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Illegal thumbnail size/offset"); ImageInfo 2535 ext/exif/exif.c if ((ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) { ImageInfo 2536 ext/exif/exif.c EXIF_ERRLOG_THUMBEOF(ImageInfo) ImageInfo 2539 ext/exif/exif.c ImageInfo->Thumbnail.data = estrndup(offset + ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); ImageInfo 2540 ext/exif/exif.c exif_thumbnail_build(ImageInfo); ImageInfo 2598 ext/exif/exif.c static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount) ImageInfo 2622 ext/exif/exif.c } else if (ImageInfo->motorola_intel) { ImageInfo 2623 ext/exif/exif.c decode = ImageInfo->decode_unicode_be; ImageInfo 2625 ext/exif/exif.c decode = ImageInfo->decode_unicode_le; ImageInfo 2633 ext/exif/exif.c zend_multibyte_fetch_encoding(ImageInfo->encode_unicode), ImageInfo 2654 ext/exif/exif.c zend_multibyte_fetch_encoding(ImageInfo->encode_jis), ImageInfo 2655 ext/exif/exif.c zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le) ImageInfo 2683 ext/exif/exif.c static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount) ImageInfo 2693 ext/exif/exif.c zend_multibyte_fetch_encoding(ImageInfo->encode_unicode), ImageInfo 2694 ext/exif/exif.c zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le) ImageInfo 2704 ext/exif/exif.c static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement) ImageInfo 2717 ext/exif/exif.c if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make))) ImageInfo 2719 ext/exif/exif.c if (maker_note->model && (!ImageInfo->model || strcmp(maker_note->model, ImageInfo->model))) ImageInfo 2729 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s @x%04X + 0x%04X=%d: %s", exif_get_sectionname(section_index), (int)dir_start-(int)offset_base+maker_note->offset+displacement, value_len, value_len, exif_char_dump(value_ptr, value_len, (int)dir_start-(int)offset_base+maker_note->offset+displacement)); ImageInfo 2732 ext/exif/exif.c ImageInfo->sections_found |= FOUND_MAKERNOTE; ImageInfo 2734 ext/exif/exif.c old_motorola_intel = ImageInfo->motorola_intel; ImageInfo 2737 ext/exif/exif.c ImageInfo->motorola_intel = 0; ImageInfo 2740 ext/exif/exif.c ImageInfo->motorola_intel = 1; ImageInfo 2747 ext/exif/exif.c NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel); ImageInfo 2754 ext/exif/exif.c offset_diff = 2 + NumDirEntries*12 + 4 - php_ifd_get32u(dir_start+10, ImageInfo->motorola_intel); ImageInfo 2756 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Using automatic offset correction: 0x%04X", ((int)dir_start-(int)offset_base+maker_note->offset+displacement) + offset_diff); ImageInfo 2766 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + x%04X*12 = x%04X > x%04X", NumDirEntries, 2+NumDirEntries*12, value_len); ImageInfo 2771 ext/exif/exif.c if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de, ImageInfo 2776 ext/exif/exif.c ImageInfo->motorola_intel = old_motorola_intel; ImageInfo 2779 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(SECTION_MAKERNOTE)); ImageInfo 2787 ext/exif/exif.c static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table) ImageInfo 2801 ext/exif/exif.c if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) { ImageInfo 2802 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "corrupt EXIF header: maximum directory nesting level reached"); ImageInfo 2805 ext/exif/exif.c ImageInfo->ifd_nesting_level++; ImageInfo 2807 ext/exif/exif.c tag = php_ifd_get16u(dir_entry, ImageInfo->motorola_intel); ImageInfo 2808 ext/exif/exif.c format = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); ImageInfo 2809 ext/exif/exif.c components = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel); ImageInfo 2813 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal format code 0x%04X, suppose BYTE", tag, exif_get_tagname(tag, tagname, -12, tag_table), format); ImageInfo 2819 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table), components); ImageInfo 2826 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal byte_count", tag, exif_get_tagname(tag, tagname, -12, tag_table)); ImageInfo 2833 ext/exif/exif.c offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); ImageInfo 2845 ext/exif/exif.c if (byte_count > ImageInfo->FileSize || offset_val>ImageInfo->FileSize-byte_count || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM && ImageInfo->FileType!=IMAGE_FILETYPE_JPEG)) { ImageInfo 2849 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X < x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val, dir_entry); ImageInfo 2853 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val, byte_count, offset_val+byte_count, IFDlength); ImageInfo 2871 ext/exif/exif.c fpos = php_stream_tell(ImageInfo->infile); ImageInfo 2872 ext/exif/exif.c php_stream_seek(ImageInfo->infile, offset_val, SEEK_SET); ImageInfo 2873 ext/exif/exif.c fgot = php_stream_tell(ImageInfo->infile); ImageInfo 2876 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Wrong file pointer: 0x%08X != 0x%08X", fgot, offset_val); ImageInfo 2879 ext/exif/exif.c fgot = php_stream_read(ImageInfo->infile, value_ptr, byte_count); ImageInfo 2880 ext/exif/exif.c php_stream_seek(ImageInfo->infile, fpos, SEEK_SET); ImageInfo 2883 ext/exif/exif.c EXIF_ERRLOG_FILEEOF(ImageInfo) ImageInfo 2893 ext/exif/exif.c ImageInfo->sections_found |= FOUND_ANY_TAG; ImageInfo 2895 ext/exif/exif.c dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr); ImageInfo 2896 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s %s", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(format), dump_data); ImageInfo 2903 ext/exif/exif.c if (!ImageInfo->Thumbnail.data) { ImageInfo 2907 ext/exif/exif.c ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 2912 ext/exif/exif.c ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 2918 ext/exif/exif.c ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 2922 ext/exif/exif.c if (ImageInfo->FileType == IMAGE_FILETYPE_TIFF_II || ImageInfo->FileType == IMAGE_FILETYPE_TIFF_MM) { ImageInfo 2923 ext/exif/exif.c ImageInfo->Thumbnail.filetype = ImageInfo->FileType; ImageInfo 2926 ext/exif/exif.c ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_TIFF_MM; ImageInfo 2928 ext/exif/exif.c ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 2932 ext/exif/exif.c if (ImageInfo->Thumbnail.filetype == IMAGE_FILETYPE_UNKNOWN) { ImageInfo 2933 ext/exif/exif.c ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_JPEG; ImageInfo 2934 ext/exif/exif.c ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 2947 ext/exif/exif.c ImageInfo->CopyrightPhotographer = estrdup(value_ptr); ImageInfo 2948 ext/exif/exif.c ImageInfo->CopyrightEditor = estrndup(value_ptr+length+1, byte_count-length-1); ImageInfo 2949 ext/exif/exif.c spprintf(&ImageInfo->Copyright, 0, "%s, %s", value_ptr, value_ptr+length+1); ImageInfo 2954 ext/exif/exif.c ImageInfo->Copyright = estrndup(value_ptr, byte_count); ImageInfo 2960 ext/exif/exif.c ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count); ImageInfo 2968 ext/exif/exif.c tmp_xp = (xp_field_type*)safe_erealloc(ImageInfo->xp_fields.list, (ImageInfo->xp_fields.count+1), sizeof(xp_field_type), 0); ImageInfo 2969 ext/exif/exif.c ImageInfo->sections_found |= FOUND_WINXP; ImageInfo 2970 ext/exif/exif.c ImageInfo->xp_fields.list = tmp_xp; ImageInfo 2971 ext/exif/exif.c ImageInfo->xp_fields.count++; ImageInfo 2972 ext/exif/exif.c exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count); ImageInfo 2978 ext/exif/exif.c ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 2985 ext/exif/exif.c if (ImageInfo->ApertureFNumber == 0) { ImageInfo 2986 ext/exif/exif.c ImageInfo->ApertureFNumber ImageInfo 2987 ext/exif/exif.c = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)*0.5); ImageInfo 2996 ext/exif/exif.c if (ImageInfo->ExposureTime == 0) { ImageInfo 2997 ext/exif/exif.c ImageInfo->ExposureTime ImageInfo 2998 ext/exif/exif.c = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2))); ImageInfo 3002 ext/exif/exif.c ImageInfo->ExposureTime = -1; ImageInfo 3006 ext/exif/exif.c ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 3010 ext/exif/exif.c ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 3016 ext/exif/exif.c ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel); ImageInfo 3020 ext/exif/exif.c switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)) { ImageInfo 3021 ext/exif/exif.c case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */ ImageInfo 3026 ext/exif/exif.c ImageInfo->FocalplaneUnits = 25.4; ImageInfo 3029 ext/exif/exif.c case 3: ImageInfo->FocalplaneUnits = 10; break; /* centimeter */ ImageInfo 3030 ext/exif/exif.c case 4: ImageInfo->FocalplaneUnits = 1; break; /* milimeter */ ImageInfo 3031 ext/exif/exif.c case 5: ImageInfo->FocalplaneUnits = .001; break; /* micrometer */ ImageInfo 3040 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Skip SUB IFD"); ImageInfo 3045 ext/exif/exif.c ImageInfo->make = estrndup(value_ptr, byte_count); ImageInfo 3048 ext/exif/exif.c ImageInfo->model = estrndup(value_ptr, byte_count); ImageInfo 3052 ext/exif/exif.c exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement); ImageInfo 3064 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found EXIF"); ImageInfo 3066 ext/exif/exif.c ImageInfo->sections_found |= FOUND_EXIF; ImageInfo 3071 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found GPS"); ImageInfo 3073 ext/exif/exif.c ImageInfo->sections_found |= FOUND_GPS; ImageInfo 3078 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found INTEROPERABILITY"); ImageInfo 3080 ext/exif/exif.c ImageInfo->sections_found |= FOUND_INTEROP; ImageInfo 3084 ext/exif/exif.c Subdir_start = offset_base + php_ifd_get32u(value_ptr, ImageInfo->motorola_intel); ImageInfo 3086 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer"); ImageInfo 3089 ext/exif/exif.c if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index)) { ImageInfo 3093 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(sub_section_index)); ImageInfo 3098 ext/exif/exif.c exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr); ImageInfo 3106 ext/exif/exif.c static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index) ImageInfo 3113 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s (x%04X(=%d))", exif_get_sectionname(section_index), IFDlength, IFDlength); ImageInfo 3116 ext/exif/exif.c ImageInfo->sections_found |= FOUND_IFD0; ImageInfo 3118 ext/exif/exif.c NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel); ImageInfo 3121 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: x%04X + 2 + x%04X*12 = x%04X > x%04X", (int)((size_t)dir_start+2-(size_t)offset_base), NumDirEntries, (int)((size_t)dir_start+2+NumDirEntries*12-(size_t)offset_base), IFDlength); ImageInfo 3126 ext/exif/exif.c if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de, ImageInfo 3141 ext/exif/exif.c NextDirOffset = php_ifd_get32u(dir_start+2+12*de, ImageInfo->motorola_intel); ImageInfo 3145 ext/exif/exif.c exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD offset"); ImageInfo 3150 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Expect next IFD to be thumbnail"); ImageInfo 3152 ext/exif/exif.c if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL)) { ImageInfo 3154 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail size: 0x%04X", ImageInfo->Thumbnail.size); ImageInfo 3156 ext/exif/exif.c if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN ImageInfo 3157 ext/exif/exif.c && ImageInfo->Thumbnail.size ImageInfo 3158 ext/exif/exif.c && ImageInfo->Thumbnail.offset ImageInfo 3159 ext/exif/exif.c && ImageInfo->read_thumbnail ImageInfo 3161 ext/exif/exif.c exif_thumbnail_extract(ImageInfo, offset_base, IFDlength); ImageInfo 3175 ext/exif/exif.c static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement) ImageInfo 3181 ext/exif/exif.c ImageInfo->motorola_intel = 0; ImageInfo 3183 ext/exif/exif.c ImageInfo->motorola_intel = 1; ImageInfo 3185 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF alignment marker"); ImageInfo 3190 ext/exif/exif.c exif_value_2a = php_ifd_get16u(CharBuf+2, ImageInfo->motorola_intel); ImageInfo 3191 ext/exif/exif.c offset_of_ifd = php_ifd_get32u(CharBuf+4, ImageInfo->motorola_intel); ImageInfo 3193 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF start (1)"); ImageInfo 3197 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid IFD start"); ImageInfo 3201 ext/exif/exif.c ImageInfo->sections_found |= FOUND_IFD0; ImageInfo 3203 ext/exif/exif.c exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0); ImageInfo 3206 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process TIFF in JPEG done"); ImageInfo 3210 ext/exif/exif.c if (ImageInfo->FocalplaneXRes != 0) { ImageInfo 3211 ext/exif/exif.c ImageInfo->CCDWidth = (float)(ImageInfo->ExifImageWidth * ImageInfo->FocalplaneUnits / ImageInfo->FocalplaneXRes); ImageInfo 3220 ext/exif/exif.c static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement) ImageInfo 3225 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Incorrect APP1 Exif Identifier Code"); ImageInfo 3228 ext/exif/exif.c exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8); ImageInfo 3230 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process APP1/EXIF done"); ImageInfo 3238 ext/exif/exif.c static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length) ImageInfo 3243 ext/exif/exif.c exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2); ImageInfo 3246 ext/exif/exif.c exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1); ImageInfo 3250 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process section APP12 with l1=%d, l2=%d done", l1, l2); ImageInfo 3257 ext/exif/exif.c static int exif_scan_JPEG_header(image_info_type *ImageInfo) ImageInfo 3268 ext/exif/exif.c fpos = php_stream_tell(ImageInfo->infile); ImageInfo 3269 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Needing section %d @ 0x%08X", ImageInfo->file.count, fpos); ImageInfo 3279 ext/exif/exif.c if ((marker = php_stream_getc(ImageInfo->infile)) == EOF) { ImageInfo 3280 ext/exif/exif.c EXIF_ERRLOG_CORRUPT(ImageInfo) ImageInfo 3293 ext/exif/exif.c exif_error_docref("exif_read_data#error_mcom" EXIFERR_CC, ImageInfo, E_NOTICE, "Image has corrupt COM section: some software set wrong length information"); ImageInfo 3298 ext/exif/exif.c fpos = php_stream_tell(ImageInfo->infile); ImageInfo 3302 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "To many padding bytes"); ImageInfo 3307 ext/exif/exif.c if ((lh = php_stream_getc(ImageInfo->infile)) == EOF) { ImageInfo 3308 ext/exif/exif.c EXIF_ERRLOG_CORRUPT(ImageInfo) ImageInfo 3311 ext/exif/exif.c if ((ll = php_stream_getc(ImageInfo->infile)) == EOF) { ImageInfo 3312 ext/exif/exif.c EXIF_ERRLOG_CORRUPT(ImageInfo) ImageInfo 3320 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s, Section length: 0x%02X%02X", EXIF_ERROR_CORRUPT, lh, ll); ImageInfo 3322 ext/exif/exif.c EXIF_ERRLOG_CORRUPT(ImageInfo) ImageInfo 3327 ext/exif/exif.c sn = exif_file_sections_add(ImageInfo, marker, itemlen+1, NULL); ImageInfo 3328 ext/exif/exif.c Data = ImageInfo->file.list[sn].data; ImageInfo 3334 ext/exif/exif.c got = php_stream_read(ImageInfo->infile, (char*)(Data+2), itemlen-2); /* Read the whole section. */ ImageInfo 3336 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error reading from file: got=x%04X(=%d) != itemlen-2=x%04X(=%d)", got, got, itemlen-2, itemlen-2); ImageInfo 3341 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process section(x%02X=%s) @ x%04X + x%04X(=%d)", marker, exif_get_markername(marker), fpos, itemlen, itemlen); ImageInfo 3346 ext/exif/exif.c if (ImageInfo->read_all) { ImageInfo 3348 ext/exif/exif.c fpos = php_stream_tell(ImageInfo->infile); ImageInfo 3349 ext/exif/exif.c size = ImageInfo->FileSize - fpos; ImageInfo 3350 ext/exif/exif.c sn = exif_file_sections_add(ImageInfo, M_PSEUDO, size, NULL); ImageInfo 3351 ext/exif/exif.c Data = ImageInfo->file.list[sn].data; ImageInfo 3352 ext/exif/exif.c got = php_stream_read(ImageInfo->infile, (char*)Data, size); ImageInfo 3354 ext/exif/exif.c EXIF_ERRLOG_FILEEOF(ImageInfo) ImageInfo 3361 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "No image in jpeg!"); ImageInfo 3362 ext/exif/exif.c return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? TRUE : FALSE; ImageInfo 3365 ext/exif/exif.c exif_process_COM(ImageInfo, (char *)Data, itemlen); ImageInfo 3369 ext/exif/exif.c if (!(ImageInfo->sections_found&FOUND_IFD0)) { ImageInfo 3373 ext/exif/exif.c exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos); ImageInfo 3378 ext/exif/exif.c exif_process_APP12(ImageInfo, (char *)Data, itemlen); ImageInfo 3400 ext/exif/exif.c ImageInfo->Width = sof_info.width; ImageInfo 3401 ext/exif/exif.c ImageInfo->Height = sof_info.height; ImageInfo 3403 ext/exif/exif.c ImageInfo->IsColor = 1; ImageInfo 3405 ext/exif/exif.c ImageInfo->IsColor = 0; ImageInfo 3417 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Done"); ImageInfo 3425 ext/exif/exif.c static int exif_scan_thumbnail(image_info_type *ImageInfo) ImageInfo 3427 ext/exif/exif.c uchar c, *data = (uchar*)ImageInfo->Thumbnail.data; ImageInfo 3436 ext/exif/exif.c if (!ImageInfo->Thumbnail.width && !ImageInfo->Thumbnail.height) { ImageInfo 3437 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Thumbnail is not a JPEG image"); ImageInfo 3443 ext/exif/exif.c if (pos>=ImageInfo->Thumbnail.size) ImageInfo 3446 ext/exif/exif.c if (pos>=ImageInfo->Thumbnail.size) ImageInfo 3453 ext/exif/exif.c if (pos+3>=ImageInfo->Thumbnail.size) ImageInfo 3461 ext/exif/exif.c if (pos+length>=ImageInfo->Thumbnail.size) { ImageInfo 3465 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process section(x%02X=%s) @ x%04X + x%04X", marker, exif_get_markername(marker), pos, length); ImageInfo 3483 ext/exif/exif.c ImageInfo->Thumbnail.height = sof_info.height; ImageInfo 3484 ext/exif/exif.c ImageInfo->Thumbnail.width = sof_info.width; ImageInfo 3486 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: size: %d * %d", sof_info.width, sof_info.height); ImageInfo 3492 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Could not compute size of thumbnail"); ImageInfo 3502 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Could not compute size of thumbnail"); ImageInfo 3509 ext/exif/exif.c static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index) ImageInfo 3518 ext/exif/exif.c if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) { ImageInfo 3522 ext/exif/exif.c if (ImageInfo->FileSize >= dir_offset+2) { ImageInfo 3523 ext/exif/exif.c sn = exif_file_sections_add(ImageInfo, M_PSEUDO, 2, NULL); ImageInfo 3525 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2); ImageInfo 3527 ext/exif/exif.c php_stream_seek(ImageInfo->infile, dir_offset, SEEK_SET); /* we do not know the order of sections */ ImageInfo 3528 ext/exif/exif.c php_stream_read(ImageInfo->infile, (char*)ImageInfo->file.list[sn].data, 2); ImageInfo 3529 ext/exif/exif.c num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel); ImageInfo 3531 ext/exif/exif.c if (ImageInfo->FileSize >= dir_offset+dir_size) { ImageInfo 3533 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries); ImageInfo 3535 ext/exif/exif.c if (exif_file_sections_realloc(ImageInfo, sn, dir_size)) { ImageInfo 3538 ext/exif/exif.c php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2); ImageInfo 3540 ext/exif/exif.c next_offset = php_ifd_get32u(ImageInfo->file.list[sn].data + dir_size - 4, ImageInfo->motorola_intel); ImageInfo 3542 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF done, next offset x%04X", next_offset); ImageInfo 3547 ext/exif/exif.c dir_entry = ImageInfo->file.list[sn].data+2+i*12; ImageInfo 3548 ext/exif/exif.c entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel); ImageInfo 3549 ext/exif/exif.c entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); ImageInfo 3551 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: tag(0x%04X,%12s): Illegal format code 0x%04X, switching to BYTE", entry_tag, exif_get_tagname(entry_tag, tagname, -12, tag_table), entry_type); ImageInfo 3559 ext/exif/exif.c entry_length = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel) * php_tiff_bytes_per_format[entry_type]; ImageInfo 3563 ext/exif/exif.c entry_value = php_ifd_get16u(dir_entry+8, ImageInfo->motorola_intel); ImageInfo 3566 ext/exif/exif.c entry_value = php_ifd_get16s(dir_entry+8, ImageInfo->motorola_intel); ImageInfo 3569 ext/exif/exif.c entry_value = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); ImageInfo 3572 ext/exif/exif.c entry_value = php_ifd_get32s(dir_entry+8, ImageInfo->motorola_intel); ImageInfo 3578 ext/exif/exif.c ImageInfo->Width = entry_value; ImageInfo 3582 ext/exif/exif.c ImageInfo->Height = entry_value; ImageInfo 3589 ext/exif/exif.c ImageInfo->IsColor = 0; ImageInfo 3596 ext/exif/exif.c ImageInfo->IsColor = 1; ImageInfo 3602 ext/exif/exif.c entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); ImageInfo 3609 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Resize struct: x%04X + x%04X - x%04X = x%04X", entry_offset, entry_length, dir_offset, ifd_size); ImageInfo 3614 ext/exif/exif.c if (ImageInfo->FileSize >= dir_offset + ImageInfo->file.list[sn].size) { ImageInfo 3616 ext/exif/exif.c if (dir_offset + ifd_size > ImageInfo->FileSize) { ImageInfo 3617 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); ImageInfo 3620 ext/exif/exif.c if (exif_file_sections_realloc(ImageInfo, sn, ifd_size)) { ImageInfo 3625 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); ImageInfo 3627 ext/exif/exif.c php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+dir_size), ifd_size-dir_size); ImageInfo 3629 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF, done"); ImageInfo 3634 ext/exif/exif.c dir_entry = ImageInfo->file.list[sn].data+2+i*12; ImageInfo 3635 ext/exif/exif.c entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel); ImageInfo 3636 ext/exif/exif.c entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); ImageInfo 3645 ext/exif/exif.c ImageInfo->sections_found |= FOUND_EXIF; ImageInfo 3649 ext/exif/exif.c ImageInfo->sections_found |= FOUND_GPS; ImageInfo 3653 ext/exif/exif.c ImageInfo->sections_found |= FOUND_INTEROP; ImageInfo 3657 ext/exif/exif.c ImageInfo->sections_found |= FOUND_THUMBNAIL; ImageInfo 3661 ext/exif/exif.c entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); ImageInfo 3663 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s @x%04X", exif_get_sectionname(sub_section_index), entry_offset); ImageInfo 3665 ext/exif/exif.c ImageInfo->ifd_nesting_level++; ImageInfo 3666 ext/exif/exif.c exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index); ImageInfo 3668 ext/exif/exif.c if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN ImageInfo 3669 ext/exif/exif.c && ImageInfo->Thumbnail.size ImageInfo 3670 ext/exif/exif.c && ImageInfo->Thumbnail.offset ImageInfo 3671 ext/exif/exif.c && ImageInfo->read_thumbnail ImageInfo 3674 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); ImageInfo 3676 ext/exif/exif.c if (!ImageInfo->Thumbnail.data) { ImageInfo 3677 ext/exif/exif.c ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0); ImageInfo 3678 ext/exif/exif.c php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET); ImageInfo 3679 ext/exif/exif.c fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); ImageInfo 3680 ext/exif/exif.c if (fgot < ImageInfo->Thumbnail.size) { ImageInfo 3681 ext/exif/exif.c EXIF_ERRLOG_THUMBEOF(ImageInfo) ImageInfo 3683 ext/exif/exif.c exif_thumbnail_build(ImageInfo); ImageInfo 3688 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s done", exif_get_sectionname(sub_section_index)); ImageInfo 3691 ext/exif/exif.c if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry, ImageInfo 3692 ext/exif/exif.c (char*)(ImageInfo->file.list[sn].data-dir_offset), ImageInfo 3703 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) at x%04X", next_offset); ImageInfo 3705 ext/exif/exif.c ImageInfo->ifd_nesting_level++; ImageInfo 3706 ext/exif/exif.c exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL); ImageInfo 3708 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); ImageInfo 3710 ext/exif/exif.c if (!ImageInfo->Thumbnail.data && ImageInfo->Thumbnail.offset && ImageInfo->Thumbnail.size && ImageInfo->read_thumbnail) { ImageInfo 3711 ext/exif/exif.c ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0); ImageInfo 3712 ext/exif/exif.c php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET); ImageInfo 3713 ext/exif/exif.c fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); ImageInfo 3714 ext/exif/exif.c if (fgot < ImageInfo->Thumbnail.size) { ImageInfo 3715 ext/exif/exif.c EXIF_ERRLOG_THUMBEOF(ImageInfo) ImageInfo 3717 ext/exif/exif.c exif_thumbnail_build(ImageInfo); ImageInfo 3720 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done"); ImageInfo 3725 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X)", ImageInfo->FileSize, dir_offset+ImageInfo->file.list[sn].size); ImageInfo 3729 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+dir_size); ImageInfo 3733 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than start of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+2); ImageInfo 3741 ext/exif/exif.c static int exif_scan_FILE_header(image_info_type *ImageInfo) ImageInfo 3746 ext/exif/exif.c ImageInfo->FileType = IMAGE_FILETYPE_UNKNOWN; ImageInfo 3748 ext/exif/exif.c if (ImageInfo->FileSize >= 2) { ImageInfo 3749 ext/exif/exif.c php_stream_seek(ImageInfo->infile, 0, SEEK_SET); ImageInfo 3750 ext/exif/exif.c if (php_stream_read(ImageInfo->infile, (char*)file_header, 2) != 2) { ImageInfo 3754 ext/exif/exif.c ImageInfo->FileType = IMAGE_FILETYPE_JPEG; ImageInfo 3755 ext/exif/exif.c if (exif_scan_JPEG_header(ImageInfo)) { ImageInfo 3758 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid JPEG file"); ImageInfo 3760 ext/exif/exif.c } else if (ImageInfo->FileSize >= 8) { ImageInfo 3761 ext/exif/exif.c if (php_stream_read(ImageInfo->infile, (char*)(file_header+2), 6) != 6) { ImageInfo 3765 ext/exif/exif.c ImageInfo->FileType = IMAGE_FILETYPE_TIFF_II; ImageInfo 3766 ext/exif/exif.c ImageInfo->motorola_intel = 0; ImageInfo 3768 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "File has TIFF/II format"); ImageInfo 3770 ext/exif/exif.c ImageInfo->sections_found |= FOUND_IFD0; ImageInfo 3771 ext/exif/exif.c if (exif_process_IFD_in_TIFF(ImageInfo, ImageInfo 3772 ext/exif/exif.c php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel), ImageInfo 3776 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file"); ImageInfo 3779 ext/exif/exif.c ImageInfo->FileType = IMAGE_FILETYPE_TIFF_MM; ImageInfo 3780 ext/exif/exif.c ImageInfo->motorola_intel = 1; ImageInfo 3782 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "File has TIFF/MM format"); ImageInfo 3784 ext/exif/exif.c ImageInfo->sections_found |= FOUND_IFD0; ImageInfo 3785 ext/exif/exif.c if (exif_process_IFD_in_TIFF(ImageInfo, ImageInfo 3786 ext/exif/exif.c php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel), ImageInfo 3790 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file"); ImageInfo 3793 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File not supported"); ImageInfo 3798 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File too small (%d)", ImageInfo->FileSize); ImageInfo 3807 ext/exif/exif.c static int exif_discard_imageinfo(image_info_type *ImageInfo) ImageInfo 3811 ext/exif/exif.c EFREE_IF(ImageInfo->FileName); ImageInfo 3812 ext/exif/exif.c EFREE_IF(ImageInfo->UserComment); ImageInfo 3813 ext/exif/exif.c EFREE_IF(ImageInfo->UserCommentEncoding); ImageInfo 3814 ext/exif/exif.c EFREE_IF(ImageInfo->Copyright); ImageInfo 3815 ext/exif/exif.c EFREE_IF(ImageInfo->CopyrightPhotographer); ImageInfo 3816 ext/exif/exif.c EFREE_IF(ImageInfo->CopyrightEditor); ImageInfo 3817 ext/exif/exif.c EFREE_IF(ImageInfo->Thumbnail.data); ImageInfo 3818 ext/exif/exif.c EFREE_IF(ImageInfo->encode_unicode); ImageInfo 3819 ext/exif/exif.c EFREE_IF(ImageInfo->decode_unicode_be); ImageInfo 3820 ext/exif/exif.c EFREE_IF(ImageInfo->decode_unicode_le); ImageInfo 3821 ext/exif/exif.c EFREE_IF(ImageInfo->encode_jis); ImageInfo 3822 ext/exif/exif.c EFREE_IF(ImageInfo->decode_jis_be); ImageInfo 3823 ext/exif/exif.c EFREE_IF(ImageInfo->decode_jis_le); ImageInfo 3824 ext/exif/exif.c EFREE_IF(ImageInfo->make); ImageInfo 3825 ext/exif/exif.c EFREE_IF(ImageInfo->model); ImageInfo 3826 ext/exif/exif.c for (i=0; i<ImageInfo->xp_fields.count; i++) { ImageInfo 3827 ext/exif/exif.c EFREE_IF(ImageInfo->xp_fields.list[i].value); ImageInfo 3829 ext/exif/exif.c EFREE_IF(ImageInfo->xp_fields.list); ImageInfo 3831 ext/exif/exif.c exif_iif_free(ImageInfo, i); ImageInfo 3833 ext/exif/exif.c exif_file_sections_free(ImageInfo); ImageInfo 3834 ext/exif/exif.c memset(ImageInfo, 0, sizeof(*ImageInfo)); ImageInfo 3841 ext/exif/exif.c static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all) ImageInfo 3848 ext/exif/exif.c memset(ImageInfo, 0, sizeof(*ImageInfo)); ImageInfo 3850 ext/exif/exif.c ImageInfo->motorola_intel = -1; /* flag as unknown */ ImageInfo 3852 ext/exif/exif.c ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", STREAM_MUST_SEEK|IGNORE_PATH, NULL); ImageInfo 3853 ext/exif/exif.c if (!ImageInfo->infile) { ImageInfo 3854 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Unable to open file"); ImageInfo 3858 ext/exif/exif.c if (php_stream_is(ImageInfo->infile, PHP_STREAM_IS_STDIO)) { ImageInfo 3861 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Not a file"); ImageInfo 3862 ext/exif/exif.c php_stream_close(ImageInfo->infile); ImageInfo 3867 ext/exif/exif.c ImageInfo->FileDateTime = st.st_mtime; ImageInfo 3868 ext/exif/exif.c ImageInfo->FileSize = st.st_size; ImageInfo 3872 ext/exif/exif.c if (!ImageInfo->FileSize) { ImageInfo 3873 ext/exif/exif.c php_stream_seek(ImageInfo->infile, 0, SEEK_END); ImageInfo 3874 ext/exif/exif.c ImageInfo->FileSize = php_stream_tell(ImageInfo->infile); ImageInfo 3875 ext/exif/exif.c php_stream_seek(ImageInfo->infile, 0, SEEK_SET); ImageInfo 3880 ext/exif/exif.c ImageInfo->FileName = estrndup(ZSTR_VAL(base), ZSTR_LEN(base)); ImageInfo 3882 ext/exif/exif.c ImageInfo->read_thumbnail = read_thumbnail; ImageInfo 3883 ext/exif/exif.c ImageInfo->read_all = read_all; ImageInfo 3884 ext/exif/exif.c ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_UNKNOWN; ImageInfo 3886 ext/exif/exif.c ImageInfo->encode_unicode = estrdup(EXIF_G(encode_unicode)); ImageInfo 3887 ext/exif/exif.c ImageInfo->decode_unicode_be = estrdup(EXIF_G(decode_unicode_be)); ImageInfo 3888 ext/exif/exif.c ImageInfo->decode_unicode_le = estrdup(EXIF_G(decode_unicode_le)); ImageInfo 3889 ext/exif/exif.c ImageInfo->encode_jis = estrdup(EXIF_G(encode_jis)); ImageInfo 3890 ext/exif/exif.c ImageInfo->decode_jis_be = estrdup(EXIF_G(decode_jis_be)); ImageInfo 3891 ext/exif/exif.c ImageInfo->decode_jis_le = estrdup(EXIF_G(decode_jis_le)); ImageInfo 3894 ext/exif/exif.c ImageInfo->ifd_nesting_level = 0; ImageInfo 3897 ext/exif/exif.c ret = exif_scan_FILE_header(ImageInfo); ImageInfo 3899 ext/exif/exif.c php_stream_close(ImageInfo->infile); ImageInfo 3913 ext/exif/exif.c image_info_type ImageInfo; ImageInfo 3920 ext/exif/exif.c memset(&ImageInfo, 0, sizeof(ImageInfo)); ImageInfo 3945 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Sections needed: %s", sections_str[0] ? sections_str : "None"); ImageInfo 3950 ext/exif/exif.c ret = exif_read_file(&ImageInfo, p_name, read_thumbnail, read_all); ImageInfo 3951 ext/exif/exif.c sections_str = exif_get_sectionlist(ImageInfo.sections_found); ImageInfo 3955 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Sections found: %s", sections_str[0] ? sections_str : "None"); ImageInfo 3958 ext/exif/exif.c ImageInfo.sections_found |= FOUND_COMPUTED|FOUND_FILE;/* do not inform about in debug*/ ImageInfo 3960 ext/exif/exif.c if (ret == FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found))) { ImageInfo 3962 ext/exif/exif.c exif_discard_imageinfo(&ImageInfo); ImageInfo 3970 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section FILE"); ImageInfo 3974 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName); ImageInfo 3975 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime); ImageInfo 3976 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize); ImageInfo 3977 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType); ImageInfo 3978 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType)); ImageInfo 3979 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE"); ImageInfo 3982 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section COMPUTED"); ImageInfo 3985 ext/exif/exif.c if (ImageInfo.Width>0 && ImageInfo.Height>0) { ImageInfo 3986 ext/exif/exif.c exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" , "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height); ImageInfo 3987 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height); ImageInfo 3988 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width); ImageInfo 3990 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor); ImageInfo 3991 ext/exif/exif.c if (ImageInfo.motorola_intel != -1) { ImageInfo 3992 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel); ImageInfo 3994 ext/exif/exif.c if (ImageInfo.FocalLength) { ImageInfo 3995 ext/exif/exif.c exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength", "%4.1Fmm", ImageInfo.FocalLength); ImageInfo 3996 ext/exif/exif.c if(ImageInfo.CCDWidth) { ImageInfo 3997 ext/exif/exif.c exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength", "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5)); ImageInfo 4000 ext/exif/exif.c if(ImageInfo.CCDWidth) { ImageInfo 4001 ext/exif/exif.c exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth", "%dmm", (int)ImageInfo.CCDWidth); ImageInfo 4003 ext/exif/exif.c if(ImageInfo.ExposureTime>0) { ImageInfo 4004 ext/exif/exif.c if(ImageInfo.ExposureTime <= 0.5) { ImageInfo 4005 ext/exif/exif.c exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime)); ImageInfo 4007 ext/exif/exif.c exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s", ImageInfo.ExposureTime); ImageInfo 4010 ext/exif/exif.c if(ImageInfo.ApertureFNumber) { ImageInfo 4011 ext/exif/exif.c exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber", "f/%.1F", ImageInfo.ApertureFNumber); ImageInfo 4013 ext/exif/exif.c if(ImageInfo.Distance) { ImageInfo 4014 ext/exif/exif.c if(ImageInfo.Distance<0) { ImageInfo 4015 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite"); ImageInfo 4017 ext/exif/exif.c exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "%0.2Fm", ImageInfo.Distance); ImageInfo 4020 ext/exif/exif.c if (ImageInfo.UserComment) { ImageInfo 4021 ext/exif/exif.c exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment); ImageInfo 4022 ext/exif/exif.c if (ImageInfo.UserCommentEncoding && strlen(ImageInfo.UserCommentEncoding)) { ImageInfo 4023 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding); ImageInfo 4027 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright); ImageInfo 4028 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer); ImageInfo 4029 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor); ImageInfo 4031 ext/exif/exif.c for (i=0; i<ImageInfo.xp_fields.count; i++) { ImageInfo 4032 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_WINXP, exif_get_tagname(ImageInfo.xp_fields.list[i].tag, NULL, 0, exif_get_tag_table(SECTION_WINXP)), ImageInfo.xp_fields.list[i].value); ImageInfo 4034 ext/exif/exif.c if (ImageInfo.Thumbnail.size) { ImageInfo 4037 ext/exif/exif.c exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data); ImageInfo 4039 ext/exif/exif.c if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) { ImageInfo 4041 ext/exif/exif.c exif_scan_thumbnail(&ImageInfo); ImageInfo 4043 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.FileType", ImageInfo.Thumbnail.filetype); ImageInfo 4044 ext/exif/exif.c exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Thumbnail.MimeType", (char*)php_image_type_to_mime_type(ImageInfo.Thumbnail.filetype)); ImageInfo 4046 ext/exif/exif.c if (ImageInfo.Thumbnail.width && ImageInfo.Thumbnail.height) { ImageInfo 4047 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height); ImageInfo 4048 ext/exif/exif.c exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width); ImageInfo 4053 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Adding image infos"); ImageInfo 4056 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FILE ); ImageInfo 4057 ext/exif/exif.c add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMPUTED ); ImageInfo 4058 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG ); ImageInfo 4059 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_IFD0 ); ImageInfo 4060 ext/exif/exif.c add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_THUMBNAIL ); ImageInfo 4061 ext/exif/exif.c add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMMENT ); ImageInfo 4062 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_EXIF ); ImageInfo 4063 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_GPS ); ImageInfo 4064 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_INTEROP ); ImageInfo 4065 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX ); ImageInfo 4066 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12 ); ImageInfo 4067 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP ); ImageInfo 4068 ext/exif/exif.c add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE ); ImageInfo 4071 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Discarding info"); ImageInfo 4074 ext/exif/exif.c exif_discard_imageinfo(&ImageInfo); ImageInfo 4090 ext/exif/exif.c image_info_type ImageInfo; ImageInfo 4092 ext/exif/exif.c memset(&ImageInfo, 0, sizeof(ImageInfo)); ImageInfo 4102 ext/exif/exif.c ret = exif_read_file(&ImageInfo, p_name, 1, 0); ImageInfo 4104 ext/exif/exif.c exif_discard_imageinfo(&ImageInfo); ImageInfo 4109 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Thumbnail data %d %d %d, %d x %d", ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.filetype, ImageInfo.Thumbnail.width, ImageInfo.Thumbnail.height); ImageInfo 4111 ext/exif/exif.c if (!ImageInfo.Thumbnail.data || !ImageInfo.Thumbnail.size) { ImageInfo 4112 ext/exif/exif.c exif_discard_imageinfo(&ImageInfo); ImageInfo 4117 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Returning thumbnail(%d)", ImageInfo.Thumbnail.size); ImageInfo 4120 ext/exif/exif.c ZVAL_STRINGL(return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size); ImageInfo 4122 ext/exif/exif.c if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) { ImageInfo 4123 ext/exif/exif.c exif_scan_thumbnail(&ImageInfo); ImageInfo 4127 ext/exif/exif.c ZVAL_LONG(p_width, ImageInfo.Thumbnail.width); ImageInfo 4128 ext/exif/exif.c ZVAL_LONG(p_height, ImageInfo.Thumbnail.height); ImageInfo 4132 ext/exif/exif.c ZVAL_LONG(p_imagetype, ImageInfo.Thumbnail.filetype); ImageInfo 4136 ext/exif/exif.c exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Discarding info"); ImageInfo 4139 ext/exif/exif.c exif_discard_imageinfo(&ImageInfo);