summaryrefslogtreecommitdiff
path: root/ext/exif/exif.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/exif/exif.c')
-rw-r--r--ext/exif/exif.c346
1 files changed, 173 insertions, 173 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 5d00672c5c..3a2d2fcb76 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -173,13 +173,13 @@ ZEND_INI_MH(OnUpdateEncode)
const zend_encoding **return_list;
size_t return_size;
if (FAILURE == zend_multibyte_parse_encoding_list(new_value->val, new_value->len,
- &return_list, &return_size, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
+ &return_list, &return_size, 0)) {
+ php_error_docref(NULL, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
return FAILURE;
}
efree(return_list);
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
ZEND_INI_MH(OnUpdateDecode)
@@ -188,13 +188,13 @@ ZEND_INI_MH(OnUpdateDecode)
const zend_encoding **return_list;
size_t return_size;
if (FAILURE == zend_multibyte_parse_encoding_list(new_value->val, new_value->len,
- &return_list, &return_size, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
+ &return_list, &return_size, 0)) {
+ php_error_docref(NULL, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
return FAILURE;
}
efree(return_list);
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
PHP_INI_BEGIN()
@@ -1003,7 +1003,7 @@ static const maker_note_type maker_note_array[] = {
/* {{{ exif_get_tagname
Get headername for tag_num or NULL if not defined */
-static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table TSRMLS_DC)
+static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table)
{
int i, t;
char tmp[32];
@@ -1160,7 +1160,7 @@ static void php_ifd_set32u(char *data, size_t value, int motorola_intel)
/* }}} */
#ifdef EXIF_DEBUG
-char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr TSRMLS_DC) /* {{{ */
+char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr) /* {{{ */
{
char *dump;
int len;
@@ -1235,7 +1235,7 @@ char * exif_dump_data(int *dump_free, int format, int components, int length, in
/* {{{ exif_convert_any_format
* Evaluate number, be it int, rational, or float from directory. */
-static double exif_convert_any_format(void *value, int format, int motorola_intel TSRMLS_DC)
+static double exif_convert_any_format(void *value, int format, int motorola_intel)
{
int s_den;
unsigned u_den;
@@ -1269,12 +1269,12 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
/* Not sure if this is correct (never seen float used in Exif format) */
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single");
+ php_error_docref(NULL, E_NOTICE, "Found value of type single");
#endif
return (double)*(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double");
+ php_error_docref(NULL, E_NOTICE, "Found value of type double");
#endif
return *(double *)value;
}
@@ -1284,7 +1284,7 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
/* {{{ exif_convert_any_to_int
* Evaluate number, be it int, rational, or float from directory. */
-static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel TSRMLS_DC)
+static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel)
{
int s_den;
unsigned u_den;
@@ -1318,12 +1318,12 @@ static size_t exif_convert_any_to_int(void *value, int format, int motorola_inte
/* Not sure if this is correct (never seen float used in Exif format) */
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single");
+ php_error_docref(NULL, E_NOTICE, "Found value of type single");
#endif
return (size_t)*(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double");
+ php_error_docref(NULL, E_NOTICE, "Found value of type double");
#endif
return (size_t)*(double *)value;
}
@@ -1455,7 +1455,7 @@ static tag_table_type exif_get_tag_table(int section)
/* {{{ exif_get_sectionlist
Return list of sectionnames specified by sectionlist. Return value must be freed
*/
-static char *exif_get_sectionlist(int sectionlist TSRMLS_DC)
+static char *exif_get_sectionlist(int sectionlist)
{
int i, len, ml = 0;
char *sections;
@@ -1577,11 +1577,11 @@ static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_ty
char *buf;
spprintf(&buf, 0, "%s(%d): %s", _file, _line, format);
- php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args TSRMLS_CC);
+ php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args);
efree(buf);
}
#else
- php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args TSRMLS_CC);
+ php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args);
#endif
va_end(args);
}
@@ -1627,7 +1627,7 @@ static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t s
/* {{{ exif_file_sections_realloc
Reallocate a file section returns 0 on success and -1 on failure
*/
-static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size TSRMLS_DC)
+static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size)
{
void *tmp;
@@ -1666,7 +1666,7 @@ static int exif_file_sections_free(image_info_type *ImageInfo)
/* {{{ exif_iif_add_value
Add a value to image_info
*/
-static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC)
+static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel)
{
size_t idex;
void *vptr;
@@ -1773,13 +1773,13 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type single");
+ php_error_docref(NULL, E_WARNING, "Found value of type single");
#endif
info_value->f = *(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type double");
+ php_error_docref(NULL, E_WARNING, "Found value of type double");
#endif
info_value->d = *(double *)value;
break;
@@ -1794,16 +1794,16 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
/* {{{ exif_iif_add_tag
Add a tag from IFD to image_info
*/
-static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC)
+static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value)
{
- exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC);
+ exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel);
}
/* }}} */
/* {{{ exif_iif_add_int
Add an int value to image_info
*/
-static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value TSRMLS_DC)
+static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1825,7 +1825,7 @@ static void exif_iif_add_int(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_str
Add a string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value TSRMLS_DC)
+static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1848,7 +1848,7 @@ static void exif_iif_add_str(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_fmt
Add a format string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name TSRMLS_DC, char *value, ...)
+static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name, char *value, ...)
{
char *tmp;
va_list arglist;
@@ -1856,7 +1856,7 @@ static void exif_iif_add_fmt(image_info_type *image_info, int section_index, cha
va_start(arglist, value);
if (value) {
vspprintf(&tmp, 0, value, arglist);
- exif_iif_add_str(image_info, section_index, name, tmp TSRMLS_CC);
+ exif_iif_add_str(image_info, section_index, name, tmp);
efree(tmp);
}
va_end(arglist);
@@ -1866,7 +1866,7 @@ static void exif_iif_add_fmt(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_str
Add a string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value TSRMLS_DC)
+static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1938,7 +1938,7 @@ static void exif_iif_free(image_info_type *image_info, int section_index) {
/* {{{ add_assoc_image_info
* Add image_info to associative array value. */
-static void add_assoc_image_info(zval *value, int sub_array, image_info_type *image_info, int section_index TSRMLS_DC)
+static void add_assoc_image_info(zval *value, int sub_array, image_info_type *image_info, int section_index)
{
char buffer[64], *val, *name, uname[64];
int i, ap, l, b, idx=0, unknown=0;
@@ -1950,7 +1950,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
zval tmpi, array;
#ifdef EXIF_DEBUG
-/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/
+/* php_error_docref(NULL, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/
#endif
if (image_info->info_list[section_index].count) {
if (sub_array) {
@@ -1970,7 +1970,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
name = uname;
}
#ifdef EXIF_DEBUG
-/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname(info_tag, buffer, -12, exif_get_tag_table(section_index) TSRMLS_CC), 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));*/
+/* php_error_docref(NULL, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname(info_tag, buffer, -12, 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));*/
#endif
if (info_data->length==0) {
add_assoc_null(&tmpi, name);
@@ -2215,9 +2215,9 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
We want to print out the marker contents as legible text;
we must guard against random junk and varying newline representations.
*/
-static void exif_process_COM (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
+static void exif_process_COM (image_info_type *image_info, char *value, size_t length)
{
- exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2 TSRMLS_CC);
+ exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2);
}
/* }}} */
@@ -2227,23 +2227,23 @@ static void exif_process_COM (image_info_type *image_info, char *value, size_t l
we must guard against random junk and varying newline representations.
*/
#ifdef EXIF_JPEG2000
-static void exif_process_CME (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
+static void exif_process_CME (image_info_type *image_info, char *value, size_t length)
{
if (length>3) {
switch(value[2]) {
case 0:
- exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value TSRMLS_CC);
+ exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value);
break;
case 1:
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Undefined JPEG2000 comment encoding");
+ php_error_docref(NULL, E_NOTICE, "Undefined JPEG2000 comment encoding");
break;
}
} else {
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "JPEG2000 comment section too small");
+ php_error_docref(NULL, E_NOTICE, "JPEG2000 comment section too small");
}
}
#endif
@@ -2279,8 +2279,8 @@ static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result)
/* }}} */
/* forward declarations */
-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 TSRMLS_DC);
-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 TSRMLS_DC);
+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);
+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);
/* {{{ exif_get_markername
Get name of marker */
@@ -2343,11 +2343,11 @@ PHP_FUNCTION(exif_tagname)
zend_long tag;
char *szTemp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &tag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &tag) == FAILURE) {
return;
}
- szTemp = exif_get_tagname(tag, NULL, 0, tag_table_IFD TSRMLS_CC);
+ szTemp = exif_get_tagname(tag, NULL, 0, tag_table_IFD);
if (tag < 0 || !szTemp || !szTemp[0]) {
RETURN_FALSE;
@@ -2359,7 +2359,7 @@ PHP_FUNCTION(exif_tagname)
/* {{{ exif_ifd_make_value
* Create a value for an ifd from an info_data pointer */
-static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel TSRMLS_DC) {
+static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel) {
size_t byte_count;
char *value_ptr, *data_ptr;
size_t i;
@@ -2435,7 +2435,7 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
/* {{{ exif_thumbnail_build
* Check and build thumbnail */
-static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
+static void exif_thumbnail_build(image_info_type *ImageInfo) {
size_t new_size, new_move, new_value;
char *new_data;
void *value_ptr;
@@ -2490,7 +2490,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
info_data = &info_list->list[i];
byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length;
#ifdef EXIF_DEBUG
- 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 TSRMLS_CC), (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);
+ 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);
#endif
if (info_data->tag==TAG_STRIP_OFFSETS || info_data->tag==TAG_JPEG_INTERCHANGE_FORMAT) {
php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel);
@@ -2501,7 +2501,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel);
php_ifd_set16u(new_data + 2, info_data->format, ImageInfo->motorola_intel);
php_ifd_set32u(new_data + 4, info_data->length, ImageInfo->motorola_intel);
- value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel TSRMLS_CC);
+ value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel);
if (byte_count <= 4) {
memmove(new_data+8, value_ptr, 4);
} else {
@@ -2527,7 +2527,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
/* {{{ exif_thumbnail_extract
* Grab the thumbnail, corrected */
-static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length TSRMLS_DC) {
+static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length) {
if (ImageInfo->Thumbnail.data) {
exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails");
return; /* Should not happen */
@@ -2549,13 +2549,13 @@ static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, siz
return;
}
ImageInfo->Thumbnail.data = estrndup(offset + ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
/* }}} */
/* {{{ exif_process_undefined
* Copy a string/buffer in Exif header to a character string and return length of allocated buffer if any. */
-static int exif_process_undefined(char **result, char *value, size_t byte_count TSRMLS_DC) {
+static int exif_process_undefined(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we have to copy NUL
* chars up to byte_count, we also have to add a single NUL character to
* force end of string.
@@ -2589,7 +2589,7 @@ static int exif_process_string_raw(char **result, char *value, size_t byte_count
/* {{{ exif_process_string
* Copy a string in Exif header to a character string and return length of allocated buffer if any.
* In contrast to exif_process_string this function does always return a string buffer */
-static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) {
+static int exif_process_string(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we cannot use strlen to
* determin length of string and we cannot use strlcpy with len=byte_count+1
* because then we might get into an EXCEPTION if we exceed an allocated
@@ -2598,7 +2598,7 @@ static int exif_process_string(char **result, char *value, size_t byte_count TSR
* estrdup would sometimes allocate more memory and does not return length
*/
if ((byte_count=php_strnlen(value, byte_count)) > 0) {
- return exif_process_undefined(result, value, byte_count TSRMLS_CC);
+ return exif_process_undefined(result, value, byte_count);
}
(*result) = estrndup("", 1); /* force empty string */
return byte_count+1;
@@ -2607,7 +2607,7 @@ static int exif_process_string(char **result, char *value, size_t byte_count TSR
/* {{{ exif_process_user_comment
* Process UserComment in IFD. */
-static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount TSRMLS_DC)
+static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount)
{
int a;
char *decode;
@@ -2642,8 +2642,8 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
&len,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
- zend_multibyte_fetch_encoding(decode TSRMLS_CC)
+ zend_multibyte_fetch_encoding(ImageInfo->encode_unicode),
+ zend_multibyte_fetch_encoding(decode)
TSRMLS_CC) == (size_t)-1) {
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
}
@@ -2663,8 +2663,8 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
&len,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_jis TSRMLS_CC),
- zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le TSRMLS_CC)
+ zend_multibyte_fetch_encoding(ImageInfo->encode_jis),
+ zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le)
TSRMLS_CC) == (size_t)-1) {
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
}
@@ -2685,14 +2685,14 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
}
/* normal text without encoding */
- exif_process_string(pszInfoPtr, szValuePtr, ByteCount TSRMLS_CC);
+ exif_process_string(pszInfoPtr, szValuePtr, ByteCount);
return strlen(*pszInfoPtr);
}
/* }}} */
/* {{{ exif_process_unicode
* Process unicode field in IFD. */
-static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC)
+static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount)
{
xp_field->tag = tag;
@@ -2702,8 +2702,8 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
&xp_field->size,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
- zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le TSRMLS_CC)
+ zend_multibyte_fetch_encoding(ImageInfo->encode_unicode),
+ zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le)
TSRMLS_CC) == (size_t)-1) {
xp_field->size = exif_process_string_raw(&xp_field->value, szValuePtr, ByteCount);
}
@@ -2713,7 +2713,7 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
/* {{{ exif_process_IFD_in_MAKERNOTE
* Process nested IFDs directories in Maker Note. */
-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 TSRMLS_DC)
+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)
{
int de, i=0, section_index = SECTION_MAKERNOTE;
int NumDirEntries, old_motorola_intel, offset_diff;
@@ -2781,7 +2781,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
for (de=0;de<NumDirEntries;de++) {
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
- offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table TSRMLS_CC)) {
+ offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table)) {
return FALSE;
}
}
@@ -2796,7 +2796,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
/* {{{ exif_process_IFD_TAG
* Process one of the nested IFDs directories. */
-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 TSRMLS_DC)
+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)
{
size_t length;
int tag, format, components;
@@ -2822,20 +2822,20 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
if (!format || format > NUM_FORMATS) {
/* (-1) catches illegal zero case as unsigned underflows to positive large. */
- 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 TSRMLS_CC), format);
+ 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);
format = TAG_FMT_BYTE;
/*return TRUE;*/
}
if (components < 0) {
- 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 TSRMLS_CC), components);
+ 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);
return FALSE;
}
byte_count_signed = (int64_t)components * php_tiff_bytes_per_format[format];
if (byte_count_signed < 0 || (byte_count_signed > INT32_MAX)) {
- 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 TSRMLS_CC));
+ 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));
return FALSE;
}
@@ -2858,11 +2858,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
if (value_ptr < dir_entry) {
/* we can read this if offset_val > 0 */
/* some files have their values in other parts of the file */
- 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 TSRMLS_CC), offset_val, dir_entry);
+ 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);
} else {
/* this is for sure not allowed */
/* exception are IFD pointers */
- 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 TSRMLS_CC), offset_val, byte_count, offset_val+byte_count, IFDlength);
+ 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);
}
return FALSE;
}
@@ -2904,8 +2904,8 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
ImageInfo->sections_found |= FOUND_ANY_TAG;
#ifdef EXIF_DEBUG
- dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr TSRMLS_CC);
- 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 TSRMLS_CC), 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);
+ dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr);
+ 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);
if (dump_free) {
efree(dump_data);
}
@@ -2916,18 +2916,18 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
switch(tag) {
case TAG_IMAGEWIDTH:
case TAG_COMP_IMAGE_WIDTH:
- ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_IMAGEHEIGHT:
case TAG_COMP_IMAGE_HEIGHT:
- ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_STRIP_OFFSETS:
case TAG_JPEG_INTERCHANGE_FORMAT:
/* accept both formats */
- ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_STRIP_BYTE_COUNTS:
@@ -2937,13 +2937,13 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* motorola is easier to read */
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_TIFF_MM;
}
- ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_JPEG_INTERCHANGE_FORMAT_LEN:
if (ImageInfo->Thumbnail.filetype == IMAGE_FILETYPE_UNKNOWN) {
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_JPEG;
- ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
}
break;
}
@@ -2969,7 +2969,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_USERCOMMENT:
- ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count TSRMLS_CC);
+ ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
break;
case TAG_XP_TITLE:
@@ -2981,13 +2981,13 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
ImageInfo->sections_found |= FOUND_WINXP;
ImageInfo->xp_fields.list = tmp_xp;
ImageInfo->xp_fields.count++;
- exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count TSRMLS_CC);
+ exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count);
break;
case TAG_FNUMBER:
/* Simplest way of expressing aperture, so I trust it the most.
(overwrite previously computed value if there is one) */
- ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_APERTURE:
@@ -2996,7 +2996,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
have appropriate aperture information yet. */
if (ImageInfo->ApertureFNumber == 0) {
ImageInfo->ApertureFNumber
- = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2)*0.5);
+ = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)*0.5);
}
break;
@@ -3007,7 +3007,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
*/
if (ImageInfo->ExposureTime == 0) {
ImageInfo->ExposureTime
- = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2)));
+ = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)));
}
break;
case TAG_EXPOSURETIME:
@@ -3015,21 +3015,21 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_COMP_IMAGE_WIDTH:
- ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_FOCALPLANE_X_RES:
- ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_SUBJECT_DISTANCE:
/* Inidcates the distacne the autofocus camera is focused to.
Tends to be less accurate as distance increases. */
- ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_FOCALPLANE_RESOLUTION_UNIT:
- switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)) {
+ switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)) {
case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */
case 2:
/* According to the information I was using, 2 measn meters.
@@ -3061,7 +3061,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_MAKER_NOTE:
- exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC);
+ exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement);
break;
case TAG_EXIF_IFD_POINTER:
@@ -3098,7 +3098,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
return FALSE;
}
- if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index TSRMLS_CC)) {
+ if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index)) {
return FALSE;
}
#ifdef EXIF_DEBUG
@@ -3107,7 +3107,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
}
}
}
- exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table TSRMLS_CC), tag, format, components, value_ptr TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr);
EFREE_IF(outside);
return TRUE;
}
@@ -3115,7 +3115,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* {{{ exif_process_IFD_in_JPEG
* Process one of the nested IFDs directories. */
-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 TSRMLS_DC)
+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)
{
int de;
int NumDirEntries;
@@ -3136,7 +3136,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
for (de=0;de<NumDirEntries;de++) {
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
- offset_base, IFDlength, displacement, section_index, 1, exif_get_tag_table(section_index) TSRMLS_CC)) {
+ offset_base, IFDlength, displacement, section_index, 1, exif_get_tag_table(section_index))) {
return FALSE;
}
}
@@ -3161,7 +3161,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Expect next IFD to be thumbnail");
#endif
- if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL TSRMLS_CC)) {
+ if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL)) {
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail size: 0x%04X", ImageInfo->Thumbnail.size);
#endif
@@ -3170,7 +3170,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
&& ImageInfo->Thumbnail.offset
&& ImageInfo->read_thumbnail
) {
- exif_thumbnail_extract(ImageInfo, offset_base, IFDlength TSRMLS_CC);
+ exif_thumbnail_extract(ImageInfo, offset_base, IFDlength);
}
return TRUE;
} else {
@@ -3184,7 +3184,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
/* {{{ exif_process_TIFF_in_JPEG
Process a TIFF header in a JPEG file
*/
-static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC)
+static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement)
{
unsigned exif_value_2a, offset_of_ifd;
@@ -3212,7 +3212,7 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
ImageInfo->sections_found |= FOUND_IFD0;
/* First directory starts at offset 8. Offsets starts at 0. */
- exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0 TSRMLS_CC);
+ exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process TIFF in JPEG done");
@@ -3229,7 +3229,7 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
Process an JPEG APP1 block marker
Describes all the drivel that most digital cameras include...
*/
-static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC)
+static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement)
{
/* Check the APP1 for Exif Identifier Code */
static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
@@ -3237,7 +3237,7 @@ static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Incorrect APP1 Exif Identifier Code");
return;
}
- exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8 TSRMLS_CC);
+ exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process APP1/EXIF done");
#endif
@@ -3247,15 +3247,15 @@ static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t
/* {{{ exif_process_APP12
Process an JPEG APP12 block marker used by OLYMPUS
*/
-static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length TSRMLS_DC)
+static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length)
{
size_t l1, l2=0;
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
- exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2);
if (length > 2+l1+1) {
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
- exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1);
}
}
#ifdef EXIF_DEBUG
@@ -3266,7 +3266,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
/* {{{ exif_scan_JPEG_header
* Parse the marker stream until SOS or EOI is seen; */
-static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_JPEG_header(image_info_type *ImageInfo)
{
int section, sn;
int marker = 0, last_marker = M_PSEUDO, comment_correction=1;
@@ -3374,7 +3374,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? TRUE : FALSE;
case M_COM: /* Comment section */
- exif_process_COM(ImageInfo, (char *)Data, itemlen TSRMLS_CC);
+ exif_process_COM(ImageInfo, (char *)Data, itemlen);
break;
case M_EXIF:
@@ -3382,12 +3382,12 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
/*ImageInfo->sections_found |= FOUND_EXIF;*/
/* Seen files from some 'U-lead' software with Vivitar scanner
that uses marker 31 later in the file (no clue what for!) */
- exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos TSRMLS_CC);
+ exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos);
}
break;
case M_APP12:
- exif_process_APP12(ImageInfo, (char *)Data, itemlen TSRMLS_CC);
+ exif_process_APP12(ImageInfo, (char *)Data, itemlen);
break;
@@ -3434,7 +3434,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
/* {{{ exif_scan_thumbnail
* scan JPEG in thumbnail (memory) */
-static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_thumbnail(image_info_type *ImageInfo)
{
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
int n, marker;
@@ -3518,7 +3518,7 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC)
/* {{{ exif_process_IFD_in_TIFF
* Parse the TIFF header; */
-static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index TSRMLS_DC)
+static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index)
{
int i, sn, num_entries, sub_section_index = 0;
unsigned char *dir_entry;
@@ -3544,7 +3544,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
#ifdef EXIF_DEBUG
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);
#endif
- if (exif_file_sections_realloc(ImageInfo, sn, dir_size TSRMLS_CC)) {
+ if (exif_file_sections_realloc(ImageInfo, sn, dir_size)) {
return FALSE;
}
php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2);
@@ -3560,7 +3560,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel);
entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel);
if (entry_type > NUM_FORMATS) {
- 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 TSRMLS_CC), entry_type);
+ 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);
/* Since this is repeated in exif_process_IFD_TAG make it a notice here */
/* and make it a warning in the exif_process_IFD_TAG which is called */
/* elsewhere. */
@@ -3629,7 +3629,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
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);
return FALSE;
}
- if (exif_file_sections_realloc(ImageInfo, sn, ifd_size TSRMLS_CC)) {
+ if (exif_file_sections_realloc(ImageInfo, sn, ifd_size)) {
return FALSE;
}
/* read values not stored in directory itself */
@@ -3675,7 +3675,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s @x%04X", exif_get_sectionname(sub_section_index), entry_offset);
#endif
ImageInfo->ifd_nesting_level++;
- exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index TSRMLS_CC);
+ exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index);
if (section_index!=SECTION_THUMBNAIL && entry_tag==TAG_SUB_IFD) {
if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN
&& ImageInfo->Thumbnail.size
@@ -3692,7 +3692,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
}
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
}
}
@@ -3702,7 +3702,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
} else {
if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry,
(char*)(ImageInfo->file.list[sn].data-dir_offset),
- ifd_size, 0, section_index, 0, tag_table TSRMLS_CC)) {
+ ifd_size, 0, section_index, 0, tag_table)) {
return FALSE;
}
}
@@ -3715,7 +3715,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) at x%04X", next_offset);
#endif
ImageInfo->ifd_nesting_level++;
- exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL TSRMLS_CC);
+ exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL);
#ifdef EXIF_DEBUG
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);
#endif
@@ -3726,7 +3726,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
}
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done");
@@ -3750,7 +3750,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
/* {{{ exif_scan_FILE_header
* Parse the marker stream until SOS or EOI is seen; */
-static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_FILE_header(image_info_type *ImageInfo)
{
unsigned char file_header[8];
int ret = FALSE;
@@ -3764,7 +3764,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
}
if ((file_header[0]==0xff) && (file_header[1]==M_SOI)) {
ImageInfo->FileType = IMAGE_FILETYPE_JPEG;
- if (exif_scan_JPEG_header(ImageInfo TSRMLS_CC)) {
+ if (exif_scan_JPEG_header(ImageInfo)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid JPEG file");
@@ -3782,7 +3782,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
ImageInfo->sections_found |= FOUND_IFD0;
if (exif_process_IFD_in_TIFF(ImageInfo,
php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel),
- SECTION_IFD0 TSRMLS_CC)) {
+ SECTION_IFD0)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
@@ -3796,7 +3796,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
ImageInfo->sections_found |= FOUND_IFD0;
if (exif_process_IFD_in_TIFF(ImageInfo,
php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel),
- SECTION_IFD0 TSRMLS_CC)) {
+ SECTION_IFD0)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
@@ -3850,7 +3850,7 @@ static int exif_discard_imageinfo(image_info_type *ImageInfo)
/* {{{ exif_read_file
*/
-static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all TSRMLS_DC)
+static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all)
{
int ret;
zend_stat_t st;
@@ -3888,7 +3888,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
}
}
- base = php_basename(FileName, strlen(FileName), NULL, 0 TSRMLS_CC);
+ base = php_basename(FileName, strlen(FileName), NULL, 0);
ImageInfo->FileName = estrndup(base->val, base->len);
zend_string_release(base);
ImageInfo->read_thumbnail = read_thumbnail;
@@ -3906,7 +3906,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
ImageInfo->ifd_nesting_level = 0;
/* Scan the JPEG headers. */
- ret = exif_scan_FILE_header(ImageInfo TSRMLS_CC);
+ ret = exif_scan_FILE_header(ImageInfo);
php_stream_close(ImageInfo->infile);
return ret;
@@ -3925,7 +3925,7 @@ PHP_FUNCTION(exif_read_data)
image_info_type ImageInfo;
char tmp[64], *sections_str, *s;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
return;
}
@@ -3950,7 +3950,7 @@ PHP_FUNCTION(exif_read_data)
EFREE_IF(sections_str);
/* now see what we need */
#ifdef EXIF_DEBUG
- sections_str = exif_get_sectionlist(sections_needed TSRMLS_CC);
+ sections_str = exif_get_sectionlist(sections_needed);
if (!sections_str) {
RETURN_FALSE;
}
@@ -3959,8 +3959,8 @@ PHP_FUNCTION(exif_read_data)
#endif
}
- ret = exif_read_file(&ImageInfo, p_name, read_thumbnail, read_all TSRMLS_CC);
- sections_str = exif_get_sectionlist(ImageInfo.sections_found TSRMLS_CC);
+ ret = exif_read_file(&ImageInfo, p_name, read_thumbnail, read_all);
+ sections_str = exif_get_sectionlist(ImageInfo.sections_found);
#ifdef EXIF_DEBUG
if (sections_str)
@@ -3983,81 +3983,81 @@ PHP_FUNCTION(exif_read_data)
#endif
/* now we can add our information */
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType) TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE" TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType);
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType));
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE");
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section COMPUTED");
#endif
if (ImageInfo.Width>0 && ImageInfo.Height>0) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" TSRMLS_CC, "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width TSRMLS_CC);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" , "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width);
}
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor);
if (ImageInfo.motorola_intel != -1) {
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel);
}
if (ImageInfo.FocalLength) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1Fmm", ImageInfo.FocalLength);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength", "%4.1Fmm", ImageInfo.FocalLength);
if(ImageInfo.CCDWidth) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength", "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
}
}
if(ImageInfo.CCDWidth) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth" TSRMLS_CC, "%dmm", (int)ImageInfo.CCDWidth);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth", "%dmm", (int)ImageInfo.CCDWidth);
}
if(ImageInfo.ExposureTime>0) {
if(ImageInfo.ExposureTime <= 0.5) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
} else {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s", ImageInfo.ExposureTime);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s", ImageInfo.ExposureTime);
}
}
if(ImageInfo.ApertureFNumber) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1F", ImageInfo.ApertureFNumber);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber", "f/%.1F", ImageInfo.ApertureFNumber);
}
if(ImageInfo.Distance) {
if(ImageInfo.Distance<0) {
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite");
} else {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2Fm", ImageInfo.Distance);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "%0.2Fm", ImageInfo.Distance);
}
}
if (ImageInfo.UserComment) {
- exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment TSRMLS_CC);
+ exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment);
if (ImageInfo.UserCommentEncoding && strlen(ImageInfo.UserCommentEncoding)) {
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding);
}
}
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor);
for (i=0; i<ImageInfo.xp_fields.count; i++) {
- exif_iif_add_str(&ImageInfo, SECTION_WINXP, exif_get_tagname(ImageInfo.xp_fields.list[i].tag, NULL, 0, exif_get_tag_table(SECTION_WINXP) TSRMLS_CC), ImageInfo.xp_fields.list[i].value TSRMLS_CC);
+ 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);
}
if (ImageInfo.Thumbnail.size) {
if (read_thumbnail) {
/* not exif_iif_add_str : this is a buffer */
- exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data TSRMLS_CC);
+ exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data);
}
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
/* try to evaluate if thumbnail data is present */
- exif_scan_thumbnail(&ImageInfo TSRMLS_CC);
+ exif_scan_thumbnail(&ImageInfo);
}
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.FileType", ImageInfo.Thumbnail.filetype TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Thumbnail.MimeType", (char*)php_image_type_to_mime_type(ImageInfo.Thumbnail.filetype) TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.FileType", ImageInfo.Thumbnail.filetype);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Thumbnail.MimeType", (char*)php_image_type_to_mime_type(ImageInfo.Thumbnail.filetype));
}
if (ImageInfo.Thumbnail.width && ImageInfo.Thumbnail.height) {
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width);
}
EFREE_IF(sections_str);
@@ -4065,19 +4065,19 @@ PHP_FUNCTION(exif_read_data)
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Adding image infos");
#endif
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FILE TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMPUTED TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_IFD0 TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_THUMBNAIL TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMMENT TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_EXIF TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_GPS TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_INTEROP TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12 TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE TSRMLS_CC);
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FILE );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMPUTED );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_IFD0 );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_THUMBNAIL );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMMENT );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_EXIF );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_GPS );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_INTEROP );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12 );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE );
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Discarding info");
@@ -4086,7 +4086,7 @@ PHP_FUNCTION(exif_read_data)
exif_discard_imageinfo(&ImageInfo);
#ifdef EXIF_DEBUG
- php_error_docref1(NULL TSRMLS_CC, Z_STRVAL_PP(p_name), E_NOTICE, "done");
+ php_error_docref1(NULL, Z_STRVAL_PP(p_name), E_NOTICE, "done");
#endif
}
/* }}} */
@@ -4107,11 +4107,11 @@ PHP_FUNCTION(exif_thumbnail)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(arg_c TSRMLS_CC, "p|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
+ if (zend_parse_parameters(arg_c, "p|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
return;
}
- ret = exif_read_file(&ImageInfo, p_name, 1, 0 TSRMLS_CC);
+ ret = exif_read_file(&ImageInfo, p_name, 1, 0);
if (ret==FALSE) {
exif_discard_imageinfo(&ImageInfo);
RETURN_FALSE;
@@ -4132,7 +4132,7 @@ PHP_FUNCTION(exif_thumbnail)
ZVAL_STRINGL(return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
if (arg_c >= 3) {
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
- exif_scan_thumbnail(&ImageInfo TSRMLS_CC);
+ exif_scan_thumbnail(&ImageInfo);
}
zval_dtor(p_width);
zval_dtor(p_height);
@@ -4151,7 +4151,7 @@ PHP_FUNCTION(exif_thumbnail)
exif_discard_imageinfo(&ImageInfo);
#ifdef EXIF_DEBUG
- php_error_docref1(NULL TSRMLS_CC, p_name, E_NOTICE, "Done");
+ php_error_docref1(NULL, p_name, E_NOTICE, "Done");
#endif
}
/* }}} */
@@ -4165,7 +4165,7 @@ PHP_FUNCTION(exif_imagetype)
php_stream * stream;
int itype = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &imagefile, &imagefile_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &imagefile, &imagefile_len) == FAILURE) {
return;
}
@@ -4175,7 +4175,7 @@ PHP_FUNCTION(exif_imagetype)
RETURN_FALSE;
}
- itype = php_getimagetype(stream, NULL TSRMLS_CC);
+ itype = php_getimagetype(stream, NULL);
php_stream_close(stream);