Skip to content

Commit e6903d4

Browse files
committed
* Fixed bug #72819 (EXIF thumbnails not read anymore)
* Fixed bug #62523 (php crashes with segfault when exif_read_data called) * Fixed the poor test case for #62523, which was a HTML document Fixing #72819 had the side effect of fixing #62523 by supporting the format as seen in bug62523_1.phpt
1 parent ce4e07e commit e6903d4

File tree

7 files changed

+25
-10
lines changed

7 files changed

+25
-10
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ PHP NEWS
1313
- EXIF:
1414
. Fixed bug #74428 (exif_read_data(): "Illegal IFD size" warning occurs with
1515
correct exif format). (bradpiccho at gmail dot com, Kalle)
16+
. Fixed bug #72819 (EXIF thumbnails not read anymore). (Kalle)
17+
. Fixed bug #62523 (php crashes with segfault when exif_read_data called).
18+
(Kalle)
1619
. Fixed bug #50660 (exif_read_data(): Illegal IFD offset (works fine with
1720
other exif readers). (skinny dot bravo at gmail dot com, Kalle)
1821

ext/exif/exif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ typedef struct {
13571357

13581358
/* Remember to update PHP_MINFO if updated */
13591359
static const maker_note_type maker_note_array[] = {
1360-
{ tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_GUESS},
1360+
{ tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL},
13611361
{ tag_table_VND_CASIO, "CASIO", NULL, NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
13621362
{ tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
13631363
{ tag_table_VND_NIKON, "NIKON", NULL, "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},

ext/exif/tests/bug62523_1.jpg

71.6 KB
Loading

ext/exif/tests/bug62523_1.phpt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ extension_loaded("exif") or die("skip need exif");
77
--FILE--
88
<?php
99
echo "Test\n";
10-
var_dump(exif_read_data(__DIR__."/bug62523_1.jpg"));
10+
var_dump(count(exif_read_data(__DIR__."/bug62523_1.jpg")));
1111
?>
1212
Done
13-
--EXPECTF--
13+
--EXPECT--
1414
Test
15-
16-
Warning: exif_read_data(bug62523_1.jpg): File not supported in %sbug62523_1.php on line %d
17-
bool(false)
15+
int(86)
1816
Done

ext/exif/tests/bug62523_2.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ echo "Test\n";
1010
var_dump(count(exif_read_data(__DIR__."/bug62523_2.jpg")));
1111
?>
1212
Done
13-
--EXPECTF--
13+
--EXPECT--
1414
Test
15-
16-
Warning: exif_read_data(bug62523_2.jpg): IFD data bad offset: 0xADB23672 length 0x0D94 in %s%ebug62523_2.php on line %d
17-
int(30)
15+
int(76)
1816
Done

ext/exif/tests/bug72819/bug72819.jpg

32 KB
Loading

ext/exif/tests/bug72819/bug72819.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #72819 (EXIF thumbnails not read anymore)
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__).'/bug72819.jpg';
11+
var_dump(strlen(exif_thumbnail($infile)));
12+
?>
13+
===DONE===
14+
--EXPECT--
15+
int(5448)
16+
===DONE===

0 commit comments

Comments
 (0)