helly Sat Dec 14 14:53:52 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/exif exif.c Log: MFH Index: php4/ext/exif/exif.c diff -u php4/ext/exif/exif.c:1.118.2.7 php4/ext/exif/exif.c:1.118.2.8 --- php4/ext/exif/exif.c:1.118.2.7 Sat Dec 14 12:50:57 2002 +++ php4/ext/exif/exif.c Sat Dec 14 14:53:52 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: exif.c,v 1.118.2.7 2002/12/14 17:50:57 helly Exp $ */ +/* $Id: exif.c,v 1.118.2.8 2002/12/14 19:53:52 helly Exp $ */ /* ToDos * @@ -58,7 +58,11 @@ #include "ext/standard/php_image.h" #include "ext/standard/info.h" -#ifdef HAVE_MBSTRING +#if defined(HAVE_MBSTRING) && !defined(COMPILE_DL_MBSTRING) +#define EXIF_USE_MBSTRING 1 +#endif + +#ifdef EXIF_USE_MBSTRING #include "ext/mbstring/mbstring.h" #endif @@ -89,7 +93,7 @@ }; /* }}} */ -#define EXIF_VERSION "1.4 $Id: exif.c,v 1.118.2.7 2002/12/14 17:50:57 helly Exp $" +#define EXIF_VERSION "1.4 $Id: exif.c,v 1.118.2.8 2002/12/14 19:53:52 helly Exp $" /* {{{ PHP_MINFO_FUNCTION */ @@ -126,7 +130,7 @@ ZEND_API ZEND_INI_MH(OnUpdateEncode) { -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING if (new_value && strlen(new_value) && !php_mb_check_encoding_list(new_value TSRMLS_CC)) { php_error_docref( NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value); return FAILURE; @@ -137,7 +141,7 @@ ZEND_API ZEND_INI_MH(OnUpdateDecode) { -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING if (!php_mb_check_encoding_list(new_value TSRMLS_CC)) { php_error_docref( NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value); return FAILURE; @@ -2507,7 +2511,7 @@ /* {{{ exif_process_string_raw * Copy a string in Exif header to a character string returns length of allocated buffer if any. */ -#ifndef HAVE_MBSTRING +#ifndef EXIF_USE_MBSTRING static int exif_process_string_raw(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 @@ -2553,7 +2557,7 @@ { int a; -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING size_t len;; #endif @@ -2564,7 +2568,7 @@ *pszEncoding = estrdup((const char*)szValuePtr); szValuePtr = szValuePtr+8; ByteCount -= 8; -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING if (ImageInfo->motorola_intel) { *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_be, &len TSRMLS_CC); } else { @@ -2585,7 +2589,7 @@ *pszEncoding = estrdup((const char*)szValuePtr); szValuePtr = szValuePtr+8; ByteCount -= 8; -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING if (ImageInfo->motorola_intel) { *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_jis, ImageInfo->decode_jis_be, &len TSRMLS_CC); } else { @@ -2624,7 +2628,7 @@ xp_field->tag = tag; /* Copy the comment */ -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING /* What if MS supports big-endian with XP? */ /* if (ImageInfo->motorola_intel) { xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_be, &xp_field->size TSRMLS_CC);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php