~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/exif/tests/exif003.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
Import upstream version 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Check for exif_read_data, Unicode user comment
 
3
--SKIPIF--
 
4
<?php 
 
5
        if (!extension_loaded('exif')) die('skip exif extension not available');
 
6
        if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
 
7
        if (!defined("EXIF_USE_MBSTRING") || !EXIF_USE_MBSTRING) die ('skip mbstring loaded by dl');
 
8
?>
 
9
--INI--
 
10
output_handler=
 
11
zlib.output_compression=0
 
12
exif.decode_unicode_motorola=UCS-2BE
 
13
exif.encode_unicode=ISO-8859-15
 
14
--FILE--
 
15
<?php
 
16
/*
 
17
  test1.jpg is a 1*1 image that does not contain any Exif/Comment information
 
18
  test2.jpg is the same image but contains Exif/Comment information and a
 
19
            copy of test1.jpg as a thumbnail.
 
20
  test3.jpg is the same as test2.jpg but with a UNICODE UserComment: &Auml;&Ouml;&&Uuml;&szlig;&auml;&ouml;&uuml;
 
21
*/
 
22
var_dump(exif_read_data(dirname(__FILE__).'/test3.jpg','',true,false));
 
23
?>
 
24
--EXPECTF--
 
25
array(5) {
 
26
  ["FILE"]=>
 
27
  array(6) {
 
28
    ["FileName"]=>
 
29
    string(9) "test3.jpg"
 
30
    ["FileDateTime"]=>
 
31
    int(%s)
 
32
    ["FileSize"]=>
 
33
    int(1240)
 
34
    ["FileType"]=>
 
35
    int(2)
 
36
    ["MimeType"]=>
 
37
    string(10) "image/jpeg"
 
38
    ["SectionsFound"]=>
 
39
    string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT"
 
40
  }
 
41
  ["COMPUTED"]=>
 
42
  array(12) {
 
43
    ["html"]=>
 
44
    string(20) "width="1" height="1""
 
45
    ["Height"]=>
 
46
    int(1)
 
47
    ["Width"]=>
 
48
    int(1)
 
49
    ["IsColor"]=>
 
50
    int(1)
 
51
    ["ByteOrderMotorola"]=>
 
52
    int(1)
 
53
    ["UserComment"]=>
 
54
    string(7) "�������"
 
55
    ["UserCommentEncoding"]=>
 
56
    string(7) "UNICODE"
 
57
    ["Copyright"]=>
 
58
    string(41) "Photo (c) M.Boerger, Edited by M.Boerger."
 
59
    ["Copyright.Photographer"]=>
 
60
    string(19) "Photo (c) M.Boerger"
 
61
    ["Copyright.Editor"]=>
 
62
    string(20) "Edited by M.Boerger."
 
63
    ["Thumbnail.FileType"]=>
 
64
    int(2)
 
65
    ["Thumbnail.MimeType"]=>
 
66
    string(10) "image/jpeg"
 
67
  }
 
68
  ["IFD0"]=>
 
69
  array(2) {
 
70
    ["Copyright"]=>
 
71
    string(19) "Photo (c) M.Boerger"
 
72
    ["UserComment"]=>
 
73
    string(7) "UNICODE"
 
74
  }
 
75
  ["THUMBNAIL"]=>
 
76
  array(2) {
 
77
    ["JPEGInterchangeFormat"]=>
 
78
    int(134)
 
79
    ["JPEGInterchangeFormatLength"]=>
 
80
    int(523)
 
81
  }
 
82
  ["COMMENT"]=>
 
83
  array(3) {
 
84
    [0]=>
 
85
    string(11) "Comment #1."
 
86
    [1]=>
 
87
    string(11) "Comment #2."
 
88
    [2]=>
 
89
    string(13) "Comment #3end"
 
90
  }
 
91
}
 
 
b'\\ No newline at end of file'