diff options
author | Stanislav Malyshev <stas@php.net> | 2019-07-07 16:16:05 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2019-07-07 16:16:05 -0700 |
commit | 57e7c3aac100f7ceb992a9a554b76235713f9a83 (patch) | |
tree | 856848fb9d9fe6b172243ffacc3fffaaa88b9e5f | |
parent | 3bde4838f47c4800ac4b9efb23e320d9fdcec638 (diff) | |
download | php-git-57e7c3aac100f7ceb992a9a554b76235713f9a83.tar.gz |
Simplify expression and remove the possibility of div by 0
Maybe should use exp2() but not sure about how supported it is.
-rw-r--r-- | ext/exif/exif.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c index e8b52bc83f..de44689902 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2683,7 +2683,7 @@ PHP_FUNCTION(exif_tagname) RETURN_FALSE; } - RETURN_STRING(szTemp) + RETURN_STRING(szTemp); } /* }}} */ @@ -3369,7 +3369,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)*log(2)*0.5); + = expf(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*logf(2.0)*0.5); } break; @@ -3380,7 +3380,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)*log(2))); + = expf(-exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*logf(2.0)); } break; case TAG_EXPOSURETIME: |