@@ -1286,9 +1286,6 @@ typedef enum mn_byte_order_t {
1286
1286
typedef enum mn_offset_mode_t {
1287
1287
MN_OFFSET_NORMAL ,
1288
1288
MN_OFFSET_MAKER
1289
- #ifdef KALLE_0
1290
- , MN_OFFSET_GUESS
1291
- #endif
1292
1289
} mn_offset_mode_t ;
1293
1290
1294
1291
typedef struct {
@@ -2357,9 +2354,6 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
2357
2354
image_info_data * info_data ;
2358
2355
zval tmpi , array ;
2359
2356
2360
- #ifdef EXIF_DEBUG
2361
- /* php_error_docref(NULL, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/
2362
- #endif
2363
2357
if (image_info -> info_list [section_index ].count ) {
2364
2358
if (sub_array ) {
2365
2359
array_init (& tmpi );
@@ -2377,9 +2371,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
2377
2371
snprintf (uname , sizeof (uname ), "%d" , unknown ++ );
2378
2372
name = uname ;
2379
2373
}
2380
- #ifdef EXIF_DEBUG
2381
- /* php_error_docref(NULL, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname_debug(info_tag, exif_get_tag_table(section_index)), info_data->length, info_data->format==TAG_FMT_STRING?(info_value&&info_value->s?info_value->s:"<no data>"):exif_get_tagformat(info_data->format));*/
2382
- #endif
2374
+
2383
2375
if (info_data -> length == 0 ) {
2384
2376
add_assoc_null (& tmpi , name );
2385
2377
} else {
@@ -2413,8 +2405,6 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
2413
2405
2414
2406
case TAG_FMT_URATIONAL :
2415
2407
case TAG_FMT_SRATIONAL :
2416
- /*case TAG_FMT_BYTE:
2417
- case TAG_FMT_SBYTE:*/
2418
2408
case TAG_FMT_USHORT :
2419
2409
case TAG_FMT_SSHORT :
2420
2410
case TAG_FMT_SINGLE :
@@ -2604,28 +2594,11 @@ static void exif_process_COM (image_info_type *image_info, char *value, size_t l
2604
2594
* Process a SOFn marker. This is useful for the image dimensions */
2605
2595
static void exif_process_SOFn (uchar * Data , int marker , jpeg_sof_info * result )
2606
2596
{
2607
- /* 0xFF SOSn SectLen(2) Bits(1) Height(2) Width(2) Channels(1) 3*Channels (1) */
2597
+ /* 0xFF SOSn SectLen(2) Bits(1) Height(2) Width(2) Channels(1) 3*Channels (1) */
2608
2598
result -> bits_per_sample = Data [2 ];
2609
2599
result -> height = php_jpg_get16 (Data + 3 );
2610
2600
result -> width = php_jpg_get16 (Data + 5 );
2611
2601
result -> num_components = Data [7 ];
2612
-
2613
- /* switch (marker) {
2614
- case M_SOF0: process = "Baseline"; break;
2615
- case M_SOF1: process = "Extended sequential"; break;
2616
- case M_SOF2: process = "Progressive"; break;
2617
- case M_SOF3: process = "Lossless"; break;
2618
- case M_SOF5: process = "Differential sequential"; break;
2619
- case M_SOF6: process = "Differential progressive"; break;
2620
- case M_SOF7: process = "Differential lossless"; break;
2621
- case M_SOF9: process = "Extended sequential, arithmetic coding"; break;
2622
- case M_SOF10: process = "Progressive, arithmetic coding"; break;
2623
- case M_SOF11: process = "Lossless, arithmetic coding"; break;
2624
- case M_SOF13: process = "Differential sequential, arithmetic coding"; break;
2625
- case M_SOF14: process = "Differential progressive, arithmetic coding"; break;
2626
- case M_SOF15: process = "Differential lossless, arithmetic coding"; break;
2627
- default: process = "Unknown"; break;
2628
- }*/
2629
2602
}
2630
2603
/* }}} */
2631
2604
@@ -3074,9 +3047,6 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
3074
3047
size_t i ;
3075
3048
int de , section_index = SECTION_MAKERNOTE ;
3076
3049
int NumDirEntries , old_motorola_intel ;
3077
- #ifdef KALLE_0
3078
- int offset_diff ;
3079
- #endif
3080
3050
const maker_note_type * maker_note ;
3081
3051
char * dir_start ;
3082
3052
int data_len ;
@@ -3092,7 +3062,6 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
3092
3062
3093
3063
maker_note = maker_note_array + i ;
3094
3064
3095
- /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s)", maker_note->make?maker_note->make:"");*/
3096
3065
if (maker_note -> make && (!ImageInfo -> make || strcmp (maker_note -> make , ImageInfo -> make )))
3097
3066
continue ;
3098
3067
if (maker_note -> id_string && strncmp (maker_note -> id_string , value_ptr , maker_note -> id_string_len ))
@@ -3134,25 +3103,6 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
3134
3103
offset_base = value_ptr ;
3135
3104
data_len = value_len ;
3136
3105
break ;
3137
- #ifdef KALLE_0
3138
- case MN_OFFSET_GUESS :
3139
- if (maker_note -> offset + 10 + 4 >= value_len ) {
3140
- /* Can not read dir_start+10 since it's beyond value end */
3141
- exif_error_docref ("exif_read_data#error_ifd" EXIFERR_CC , ImageInfo , E_WARNING , "IFD data too short: 0x%04X" , value_len );
3142
- return FALSE;
3143
- }
3144
- offset_diff = 2 + NumDirEntries * 12 + 4 - php_ifd_get32u (dir_start + 10 , ImageInfo -> motorola_intel );
3145
- #ifdef EXIF_DEBUG
3146
- 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 );
3147
- #endif
3148
- if (offset_diff < 0 || offset_diff >= value_len ) {
3149
- exif_error_docref ("exif_read_data#error_ifd" EXIFERR_CC , ImageInfo , E_WARNING , "IFD data bad offset: 0x%04X length 0x%04X" , offset_diff , value_len );
3150
- return FALSE;
3151
- }
3152
- offset_base = value_ptr + offset_diff ;
3153
- data_len = value_len - offset_diff ;
3154
- break ;
3155
- #endif
3156
3106
default :
3157
3107
case MN_OFFSET_NORMAL :
3158
3108
data_len = value_len ;
@@ -3221,7 +3171,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
3221
3171
/* (-1) catches illegal zero case as unsigned underflows to positive large. */
3222
3172
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_debug (tag , tag_table ), format );
3223
3173
format = TAG_FMT_BYTE ;
3224
- /*return TRUE;*/
3225
3174
}
3226
3175
3227
3176
byte_count_signed = (int64_t )components * php_tiff_bytes_per_format [format ];
@@ -3989,7 +3938,6 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
3989
3938
return FALSE;
3990
3939
}
3991
3940
php_stream_read (ImageInfo -> infile , (char * )(ImageInfo -> file .list [sn ].data + 2 ), dir_size - 2 );
3992
- /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 0));*/
3993
3941
next_offset = php_ifd_get32u (ImageInfo -> file .list [sn ].data + dir_size - 4 , ImageInfo -> motorola_intel );
3994
3942
#ifdef EXIF_DEBUG
3995
3943
exif_error_docref (NULL EXIFERR_CC , ImageInfo , E_NOTICE , "Read from TIFF done, next offset x%04X" , next_offset );
@@ -4328,7 +4276,6 @@ static int exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream, i
4328
4276
/* Store file date/time. */
4329
4277
ImageInfo -> FileDateTime = st .st_mtime ;
4330
4278
ImageInfo -> FileSize = st .st_size ;
4331
- /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Opened stream is file: %d", ImageInfo->FileSize);*/
4332
4279
}
4333
4280
} else {
4334
4281
if (!ImageInfo -> FileSize ) {
0 commit comments