Skip to content

Commit fb18b8b

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
2 parents 2c4425a + 9ec519e commit fb18b8b

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ PHP NEWS
99
- COM:
1010
. Fixed bug #77177 (Serializing or unserializing COM objects crashes). (cmb)
1111

12+
- Exif:
13+
. Fixed bug #77184 (Unsigned rational numbers are written out as signed
14+
rationals). (Colin Basnett)
15+
1216
- GD:
1317
. Fixed bug #77195 (Incorrect error handling of imagecreatefromjpeg()). (cmb)
1418
. Fixed bug #77198 (auto cropping has insufficient precision). (cmb)

ext/exif/exif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
24152415
break;
24162416

24172417
case TAG_FMT_URATIONAL:
2418-
snprintf(buffer, sizeof(buffer), "%i/%i", info_value->ur.num, info_value->ur.den);
2418+
snprintf(buffer, sizeof(buffer), "%u/%u", info_value->ur.num, info_value->ur.den);
24192419
if (l==1) {
24202420
add_assoc_string(&tmpi, name, buffer);
24212421
} else {
25.4 KB
Loading

ext/exif/tests/bug77184/bug77184.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Bug #74428 (Unsigned rational numbers are written out as signed rationals)
3+
--SKIPIF--
4+
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5+
--INI--
6+
output_handler=
7+
zlib.output_compression=0
8+
--FILE--
9+
<?php
10+
$infile = dirname(__FILE__).'/DJI_0245_tiny.JPG';
11+
$tags = exif_read_data($infile);
12+
echo $tags['GPSLatitude'][2], PHP_EOL;
13+
echo $tags['GPSLongitude'][2], PHP_EOL;
14+
?>
15+
===DONE===
16+
--EXPECTF--
17+
156691934/70000000
18+
2672193571/70000000
19+
===DONE===

0 commit comments

Comments
 (0)