diff options
| author | Marcus Boerger <helly@php.net> | 2002-03-06 22:01:45 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2002-03-06 22:01:45 +0000 |
| commit | ac80c9d00e5edabf4679d6e242cfdaf7fba9a841 (patch) | |
| tree | 497c0f7c7f6be4a6033444908efea9839a2e7d6b /ext/exif/tests | |
| parent | 0a0942b19311dce860150db037ddab38742664e2 (diff) | |
| download | php-git-ac80c9d00e5edabf4679d6e242cfdaf7fba9a841.tar.gz | |
- standard test scripts for exif
#hope all problems in exif are resolved now
Diffstat (limited to 'ext/exif/tests')
| -rw-r--r-- | ext/exif/tests/001.phpt | 26 | ||||
| -rw-r--r-- | ext/exif/tests/002.phpt | 26 | ||||
| -rw-r--r-- | ext/exif/tests/test1.jpg | bin | 0 -> 523 bytes | |||
| -rw-r--r-- | ext/exif/tests/test2.jpg | bin | 0 -> 1240 bytes |
4 files changed, 52 insertions, 0 deletions
diff --git a/ext/exif/tests/001.phpt b/ext/exif/tests/001.phpt new file mode 100644 index 0000000000..4fc885917b --- /dev/null +++ b/ext/exif/tests/001.phpt @@ -0,0 +1,26 @@ +--TEST-- +Check for exif_read_data +--SKIPIF-- +<?php if (!extension_loaded("exif")) print "skip";?> +--POST-- +--GET-- +--FILE-- +<?php +/* + test1.jpg is a 1*1 image that does not contain any Exif/Comment information + test2.jpg is the same image but contains Exif/Comment information and a + copy of test1.jpg as a thumbnail. +*/ +$image = exif_read_data('test2.jpg','',true,false); +$accept = ''; +foreach($image as $idx=>$section) { + $accept .= $section; + foreach($section as $name=>$value) { + $accept .= substr($name,0,2); + $accept .= $value; + } +} +echo $accept; +?> +--EXPECT-- +ArrayFitest2.jpgFi1015448798Fi1240SeCOMPUTED, ANY_TAG, IFD0, THUMBNAIL, COMMENT, EXIFArrayCoPhoto (c) M.BoergerCoEdited by M.Boerger.htwidth="1" height="1"He1Wi1Is1UsExif test image.UsASCIIArrayCoPhoto (c) M.BoergerUsASCIIArrayJP523Array0Comment #1.1Comment #2.2Comment #3end
\ No newline at end of file diff --git a/ext/exif/tests/002.phpt b/ext/exif/tests/002.phpt new file mode 100644 index 0000000000..687090e74e --- /dev/null +++ b/ext/exif/tests/002.phpt @@ -0,0 +1,26 @@ +--TEST-- +Check for exif_thumbnail +--SKIPIF-- +<?php if (!extension_loaded("exif")) print "skip";?> +--POST-- +--GET-- +--FILE-- +<?php +/* + test1.jpg is a 1*1 image that does not contain any Exif/Comment information + test2.jpg is the same image but contains Exif/Comment information and a + copy of test1.jpg as a thumbnail. +*/ +$istat= stat('test1.jpg'); +$fp = fopen('test1.jpg','r'); +$image = fread($fp,$istat[7]); +echo substr($image,490,5).'_'.$istat[7]; +fclose($fp); +$thumb = exif_thumbnail('test2.jpg'); +echo strcmp($image,$thumb) ? 'different' : '_identical_'; +echo strlen($thumb); +echo '_'.substr($thumb,490,5); +/* 7GWgw_523_identical_523_7GWgw */ +?> +--EXPECT-- +7GWgw_523_identical_523_7GWgw
\ No newline at end of file diff --git a/ext/exif/tests/test1.jpg b/ext/exif/tests/test1.jpg Binary files differnew file mode 100644 index 0000000000..121decb65a --- /dev/null +++ b/ext/exif/tests/test1.jpg diff --git a/ext/exif/tests/test2.jpg b/ext/exif/tests/test2.jpg Binary files differnew file mode 100644 index 0000000000..0d7018663a --- /dev/null +++ b/ext/exif/tests/test2.jpg |
