diff --git a/ext/exif/tests/001.phpt b/ext/exif/tests/001.phpt index 69f0e2894f0..a66fc5ff52c 100644 --- a/ext/exif/tests/001.phpt +++ b/ext/exif/tests/001.phpt @@ -2,8 +2,6 @@ Check for exif_read_data --SKIPIF-- ---POST-- ---GET-- --FILE-- $section) { - $accept .= $section; - foreach($section as $name=>$value) { - if ( $idx!='FILE' || $name!='FileDateTime') { - $accept .= substr($name,0,2); - $accept .= $value; - } - } -} -echo $accept; +var_dump(exif_read_data('./ext/exif/tests/test2.jpg','',true,false)); ?> ---EXPECT-- -ArrayFitest2.jpgFi1240Fi2Miimage/jpegSeANY_TAG, IFD0, THUMBNAIL, COMMENTArrayhtwidth="1" height="1"He1Wi1Is1By1UsExif test image.UsASCIICoPhoto (c) M.Boerger, Edited by M.Boerger.CoPhoto (c) M.BoergerCoEdited by M.Boerger.Th2Thimage/jpegArrayCoPhoto (c) M.BoergerUsASCIIArrayJP134JP523Array0Comment #1.1Comment #2.2Comment #3end \ No newline at end of file +--EXPECTF-- +array(5) { + ["FILE"]=> + array(6) { + ["FileName"]=> + string(9) "test2.jpg" + ["FileDateTime"]=> + int(%d) + ["FileSize"]=> + int(1240) + ["FileType"]=> + int(2) + ["MimeType"]=> + string(10) "image/jpeg" + ["SectionsFound"]=> + string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT" + } + ["COMPUTED"]=> + array(12) { + ["html"]=> + string(20) "width="1" height="1"" + ["Height"]=> + int(1) + ["Width"]=> + int(1) + ["IsColor"]=> + int(1) + ["ByteOrderMotorola"]=> + int(1) + ["UserComment"]=> + string(16) "Exif test image." + ["UserCommentEncoding"]=> + string(5) "ASCII" + ["Copyright"]=> + string(41) "Photo (c) M.Boerger, Edited by M.Boerger." + ["Copyright.Photographer"]=> + string(19) "Photo (c) M.Boerger" + ["Copyright.Editor"]=> + string(20) "Edited by M.Boerger." + ["Thumbnail.FileType"]=> + int(2) + ["Thumbnail.MimeType"]=> + string(10) "image/jpeg" + } + ["IFD0"]=> + array(2) { + ["Copyright"]=> + string(19) "Photo (c) M.Boerger" + ["UserComment"]=> + string(5) "ASCII" + } + ["THUMBNAIL"]=> + array(2) { + ["JPEGInterchangeFormat"]=> + int(134) + ["JPEGInterchangeFormatLength"]=> + int(523) + } + ["COMMENT"]=> + array(3) { + [0]=> + string(11) "Comment #1." + [1]=> + string(11) "Comment #2." + [2]=> + string(13) "Comment #3end" + } +} \ No newline at end of file diff --git a/ext/exif/tests/003.phpt b/ext/exif/tests/003.phpt index 68c1da82f8c..79eded29f2d 100644 --- a/ext/exif/tests/003.phpt +++ b/ext/exif/tests/003.phpt @@ -15,18 +15,73 @@ exif.encode_unicode=ISO-8859-15 copy of test1.jpg as a thumbnail. test3.jpg is the same as test2.jpg but with a UNICODE UserComment: ÄÖ&Üßäöü */ -$image = exif_read_data('./ext/exif/tests/test3.jpg','',true,false); -$accept = ''; -foreach($image as $idx=>$section) { - $accept .= $section; - foreach($section as $name=>$value) { - if ( $idx!='FILE' || $name!='FileDateTime') { - $accept .= substr($name,0,2); - $accept .= $value; - } - } -} -echo $accept; +var_dump(exif_read_data('./ext/exif/tests/test3.jpg','',true,false)); ?> ---EXPECT-- -ArrayFitest3.jpgFi1240Fi2Miimage/jpegSeANY_TAG, IFD0, THUMBNAIL, COMMENTArrayhtwidth="1" height="1"He1Wi1Is1By1UsÄÖÜßäöüUsUNICODECoPhoto (c) M.Boerger, Edited by M.Boerger.CoPhoto (c) M.BoergerCoEdited by M.Boerger.Th2Thimage/jpegArrayCoPhoto (c) M.BoergerUsUNICODEArrayJP134JP523Array0Comment #1.1Comment #2.2Comment #3end \ No newline at end of file +--EXPECTF-- +array(5) { + ["FILE"]=> + array(6) { + ["FileName"]=> + string(9) "test3.jpg" + ["FileDateTime"]=> + int(%s) + ["FileSize"]=> + int(1240) + ["FileType"]=> + int(2) + ["MimeType"]=> + string(10) "image/jpeg" + ["SectionsFound"]=> + string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT" + } + ["COMPUTED"]=> + array(12) { + ["html"]=> + string(20) "width="1" height="1"" + ["Height"]=> + int(1) + ["Width"]=> + int(1) + ["IsColor"]=> + int(1) + ["ByteOrderMotorola"]=> + int(1) + ["UserComment"]=> + string(7) "ÄÖÜßäöü" + ["UserCommentEncoding"]=> + string(7) "UNICODE" + ["Copyright"]=> + string(41) "Photo (c) M.Boerger, Edited by M.Boerger." + ["Copyright.Photographer"]=> + string(19) "Photo (c) M.Boerger" + ["Copyright.Editor"]=> + string(20) "Edited by M.Boerger." + ["Thumbnail.FileType"]=> + int(2) + ["Thumbnail.MimeType"]=> + string(10) "image/jpeg" + } + ["IFD0"]=> + array(2) { + ["Copyright"]=> + string(19) "Photo (c) M.Boerger" + ["UserComment"]=> + string(7) "UNICODE" + } + ["THUMBNAIL"]=> + array(2) { + ["JPEGInterchangeFormat"]=> + int(134) + ["JPEGInterchangeFormatLength"]=> + int(523) + } + ["COMMENT"]=> + array(3) { + [0]=> + string(11) "Comment #1." + [1]=> + string(11) "Comment #2." + [2]=> + string(13) "Comment #3end" + } +} \ No newline at end of file