From: Marcus Boerger Date: Sun, 23 Jun 2002 00:43:11 +0000 (+0000) Subject: -imagetype2mimetype renamed to image_type_to_mime_type X-Git-Tag: php-4.3.0dev_zend2_alpha2~140 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f56d4ba08b70e33c0a174d6352c88c22e91127f;p=php -imagetype2mimetype renamed to image_type_to_mime_type --- diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 3a917140d4..87a6e6df0d 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3330,7 +3330,7 @@ PHP_FUNCTION(exif_read_data) 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_imagetype2mimetype(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 @@ -3396,7 +3396,7 @@ PHP_FUNCTION(exif_read_data) exif_scan_thumbnail(&ImageInfo); } exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.FileType", ImageInfo.Thumbnail.filetype); - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Thumbnail.MimeType", (char*)php_imagetype2mimetype(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); diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 89c1cacd01..1008825db8 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -281,7 +281,7 @@ function_entry basic_functions[] = { PHP_FE(iptcparse, NULL) PHP_FE(iptcembed, NULL) PHP_FE(getimagesize, second_args_force_ref) - PHP_FE(imagetype2mimetype, NULL) + PHP_FE(image_type_to_mime_type, NULL) PHP_FE(phpinfo, NULL) PHP_FE(phpversion, NULL) diff --git a/ext/standard/image.c b/ext/standard/image.c index 3e7ef909a8..80eb9a162b 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -65,7 +65,7 @@ PHPAPI const char php_sig_png[8] = {(char) 0x89, (char) 0x50, (char) 0x4e, (char PHPAPI const char php_sig_tif_ii[4] = {'I','I', (char)0x2A, (char)0x00}; PHPAPI const char php_sig_tif_mm[4] = {'M','M', (char)0x00, (char)0x2A}; PHPAPI const char php_sig_jpc[3] = {(char)0xFF, (char)0x4F, (char)0xff}; -/* REMEMBER TO ADD MIME-TYPE TO FUNCTION php_imagetype2mimetype */ +/* REMEMBER TO ADD MIME-TYPE TO FUNCTION php_image_type_to_mime_type */ /* return info as a struct, to make expansion easier */ @@ -668,9 +668,9 @@ static struct gfxinfo *php_handle_tiff (php_stream * stream, pval *info, int mot } /* }}} */ -/* {{{ php_imagetype2mimetype +/* {{{ php_image_type_to_mime_type * Convert internal image_type to mime type */ -PHPAPI const char * php_imagetype2mimetype(int image_type) +PHPAPI const char * php_image_type_to_mime_type(int image_type) { switch( image_type) { case IMAGE_FILETYPE_GIF: @@ -697,9 +697,9 @@ PHPAPI const char * php_imagetype2mimetype(int image_type) } /* }}} */ -/* {{{ proto array imagetype2mimetype(int imagetype) +/* {{{ proto array image_type_to_mime_type(int imagetype) Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype */ -PHP_FUNCTION(imagetype2mimetype) +PHP_FUNCTION(image_type_to_mime_type) { zval **p_image_type; int arg_c = ZEND_NUM_ARGS(); @@ -708,7 +708,7 @@ PHP_FUNCTION(imagetype2mimetype) WRONG_PARAM_COUNT; } zval_dtor(*p_image_type); - ZVAL_STRING(return_value, (char*)php_imagetype2mimetype(Z_LVAL_PP(p_image_type)), 1); + ZVAL_STRING(return_value, (char*)php_image_type_to_mime_type(Z_LVAL_PP(p_image_type)), 1); } /* }}} */ @@ -868,7 +868,7 @@ PHP_FUNCTION(getimagesize) if (result->channels != 0) { add_assoc_long(return_value, "channels", result->channels); } - add_assoc_string(return_value, "mime", (char*)php_imagetype2mimetype(itype), 1); + add_assoc_string(return_value, "mime", (char*)php_image_type_to_mime_type(itype), 1); efree(result); } else { RETURN_FALSE; diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h index 47373aeb3b..69536c269e 100644 --- a/ext/standard/php_image.h +++ b/ext/standard/php_image.h @@ -24,7 +24,7 @@ PHP_FUNCTION(getimagesize); -PHP_FUNCTION(imagetype2mimetype); +PHP_FUNCTION(image_type_to_mime_type); /* {{{ enum image_filetype This enum is used to have ext/standard/image.c and ext/exif/exif.c use @@ -51,6 +51,6 @@ typedef enum PHPAPI int php_getimagetype(php_stream *stream, char *filetype TSRMLS_DC); -PHPAPI const char * php_imagetype2mimetype(int image_type); +PHPAPI const char * php_image_type_to_mime_type(int image_type); #endif /* PHP_IMAGE_H */