Skip to content

Commit 671829b

Browse files
committed
#ws
1 parent f2ae5b7 commit 671829b

File tree

1 file changed

+59
-59
lines changed

1 file changed

+59
-59
lines changed

ext/exif/exif.c

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -534,28 +534,27 @@ static char * exif_get_tagname(int tag_num, char *ret, int len)
534534
#ifdef EXIF_DEBUG
535535
static unsigned char* exif_char_dump( unsigned char * addr, int len, int hex)
536536
{
537-
static unsigned char buf[1024+1];
538-
int c, i, p=0, n = hex ? 5 : 3;
539-
540-
for(i=0; i<len && p+n<=sizeof(buf); i++)
541-
{
542-
if ( i%64==0) buf[p++] = '\n';
543-
c = *addr++;
544-
if ( hex)
545-
{
546-
sprintf(buf+p,"%02X ",c);
547-
p += 3;
548-
} else {
549-
if (c>=32)
550-
{
551-
buf[p++] = c;
552-
} else {
553-
buf[p++] = '?';
554-
}
555-
}
556-
}
557-
buf[sizeof(buf)-1]=0;
558-
return buf;
537+
static unsigned char buf[1024+1];
538+
int c, i, p=0, n = hex ? 5 : 3;
539+
540+
for(i=0; i<len && p+n<=sizeof(buf); i++)
541+
{
542+
if (i%64==0)
543+
buf[p++] = '\n';
544+
c = *addr++;
545+
if (hex) {
546+
sprintf(buf+p,"%02X ",c);
547+
p += 3;
548+
} else {
549+
if (c>=32) {
550+
buf[p++] = c;
551+
} else {
552+
buf[p++] = '?';
553+
}
554+
}
555+
}
556+
buf[sizeof(buf)-1]=0;
557+
return buf;
559558
}
560559
#endif
561560
/* }}} */
@@ -792,12 +791,12 @@ typedef struct {
792791
#define SECTION_THUMBNAIL 4
793792
#define SECTION_COMMENT 5
794793
#define SECTION_APP0 6
795-
#define SECTION_EXIF 7
796-
#define SECTION_FPIX 8
794+
#define SECTION_EXIF 7
795+
#define SECTION_FPIX 8
797796
#define SECTION_GPS 9
798797
#define SECTION_INTEROP 10
799798
#define SECTION_APP12 11
800-
#define SECTION_COUNT 12
799+
#define SECTION_COUNT 12
801800

802801
#define FOUND_FILE (1<<SECTION_FILE)
803802
#define FOUND_COMPUTED (1<<SECTION_COMPUTED)
@@ -815,18 +814,18 @@ typedef struct {
815814
static char *exif_get_sectionname(int section)
816815
{
817816
switch(section) {
818-
case SECTION_FILE: return "FILE";
819-
case SECTION_COMPUTED: return "COMPUTED";
820-
case SECTION_ANY_TAG: return "ANY_TAG";
821-
case SECTION_IFD0: return "IFD0";
822-
case SECTION_THUMBNAIL: return "THUMBNAIL";
823-
case SECTION_COMMENT: return "COMMENT";
824-
case SECTION_APP0: return "APP0";
825-
case SECTION_EXIF: return "EXIF";
826-
case SECTION_FPIX: return "FPIX";
827-
case SECTION_GPS: return "GPS";
828-
case SECTION_INTEROP: return "INTEROP";
829-
case SECTION_APP12: return "APP12";
817+
case SECTION_FILE: return "FILE";
818+
case SECTION_COMPUTED: return "COMPUTED";
819+
case SECTION_ANY_TAG: return "ANY_TAG";
820+
case SECTION_IFD0: return "IFD0";
821+
case SECTION_THUMBNAIL: return "THUMBNAIL";
822+
case SECTION_COMMENT: return "COMMENT";
823+
case SECTION_APP0: return "APP0";
824+
case SECTION_EXIF: return "EXIF";
825+
case SECTION_FPIX: return "FPIX";
826+
case SECTION_GPS: return "GPS";
827+
case SECTION_INTEROP: return "INTEROP";
828+
case SECTION_APP12: return "APP12";
830829
}
831830
return "";
832831
}
@@ -840,7 +839,9 @@ static char *exif_get_sectionlist(int sectionlist)
840839
int i,len=0;
841840
char *sections;
842841

843-
for(i=0; i<SECTION_COUNT; i++) len += strlen(exif_get_sectionname(i))+2;
842+
for(i=0; i<SECTION_COUNT; i++) {
843+
len += strlen(exif_get_sectionname(i))+2;
844+
}
844845
sections = emalloc(len+1);
845846
if ( !sections) {
846847
EXIF_ERRLOG_EALLOC
@@ -854,7 +855,8 @@ static char *exif_get_sectionlist(int sectionlist)
854855
len = strlen(sections);
855856
}
856857
}
857-
if (len>2) sections[len-2] = '\0';
858+
if (len>2)
859+
sections[len-2] = '\0';
858860
return sections;
859861
}
860862
/* }}} */
@@ -866,18 +868,18 @@ static char *exif_get_sectionlist(int sectionlist)
866868
*/
867869

868870
typedef struct {
869-
int type;
870-
size_t size;
871-
uchar *data;
871+
int type;
872+
size_t size;
873+
uchar *data;
872874
} file_section;
873875

874876
typedef struct {
875-
int count;
876-
file_section *list;
877+
int count;
878+
file_section *list;
877879
} file_section_list;
878880

879881
typedef struct {
880-
image_filetype filetype;
882+
image_filetype filetype;
881883
size_t width, height;
882884
size_t size;
883885
size_t offset;
@@ -891,7 +893,7 @@ typedef struct {
891893
char *FileName;
892894
time_t FileDateTime;
893895
size_t FileSize;
894-
image_filetype FileType;
896+
image_filetype FileType;
895897
int Height, Width;
896898
int IsColor;
897899

@@ -927,7 +929,7 @@ typedef struct {
927929
/* {{{ jpeg_sof_info
928930
*/
929931
typedef struct {
930-
int bits_per_sample;
932+
int bits_per_sample;
931933
size_t width;
932934
size_t height;
933935
int num_components;
@@ -940,8 +942,8 @@ typedef struct {
940942
*/
941943
int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t size, uchar *data)
942944
{
943-
file_section *tmp;
944-
int count = ImageInfo->file.count;
945+
file_section *tmp;
946+
int count = ImageInfo->file.count;
945947

946948
tmp = erealloc(ImageInfo->file.list,(count+1)*sizeof(file_section));
947949
if ( tmp == NULL) return 0;
@@ -1003,7 +1005,7 @@ void exif_iif_add_value( image_info_type *image_info, int section_index, char *n
10031005
}
10041006
image_info->info_list[section_index].list = list;
10051007

1006-
info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count];
1008+
info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count];
10071009
info_data->tag = tag;
10081010
info_data->format = format;
10091011
info_data->length = length;
@@ -1158,7 +1160,7 @@ void exif_iif_add_int( image_info_type *image_info, int section_index, char *nam
11581160
}
11591161
image_info->info_list[section_index].list = list;
11601162

1161-
info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count];
1163+
info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count];
11621164
info_data->tag = TAG_NONE;
11631165
info_data->format = TAG_FMT_SLONG;
11641166
info_data->length = 1;
@@ -1183,20 +1185,18 @@ void exif_iif_add_str( image_info_type *image_info, int section_index, char *nam
11831185
char tmp[1024];
11841186
va_list arglist;
11851187

1186-
va_start( arglist, value );
1187-
if ( value) vsnprintf( tmp, sizeof(tmp), value, arglist);
1188-
va_end( arglist);
1188+
va_start( arglist, value );
1189+
if ( value) vsnprintf( tmp, sizeof(tmp), value, arglist);
1190+
va_end( arglist);
11891191

11901192
if ( value) {
1191-
1192-
list = erealloc(image_info->info_list[section_index].list,(image_info->info_list[section_index].count+1)*sizeof(image_info_data));
1193+
list = erealloc(image_info->info_list[section_index].list,(image_info->info_list[section_index].count+1)*sizeof(image_info_data));
11931194
if ( !list) {
11941195
EXIF_ERRLOG_EALLOC
11951196
return;
11961197
}
11971198
image_info->info_list[section_index].list = list;
1198-
1199-
info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count];
1199+
info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count];
12001200
info_data->tag = TAG_NONE;
12011201
info_data->format = TAG_FMT_STRING;
12021202
info_data->length = 1;
@@ -1546,7 +1546,7 @@ void add_assoc_image_info( pval *value, int sub_array, image_info_type *image_in
15461546
*/
15471547
static void exif_process_COM (image_info_type *image_info, uchar *value, int length)
15481548
{
1549-
exif_iif_add_tag( image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2);
1549+
exif_iif_add_tag( image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2);
15501550
}
15511551
/* }}} */
15521552

0 commit comments

Comments
 (0)