OSDN Git Service

replaceActionString の ActionPush 入れ替えのテスト
[swfed/swfed.git] / www / swfimagelist.php
1 <?php
2
3 require_once('define.php');
4
5 $id = $_REQUEST['id'];
6
7 $filename = "$tmp_prefix$id.swf";
8 $swfdata = file_get_contents($filename);
9
10 $swf = new SWFEditor();
11 $swf->input($swfdata);
12
13 echo "<table border=1>\n";
14 echo "<th> tag </th> <th> cid </th> <th> image </th>\n";
15 $tag_list = $swf->getTagList();
16
17 foreach ($tag_list as $tag_seqno => &$tagblock) {
18         $tagblock['detail_info'] = $swf->getTagDetail($tag_seqno);
19 }
20
21 // getTagDetail 後に getShape が動かないバグの対処で仕方なく
22 $swf = new SWFEditor();
23 $swf->input($swfdata);
24
25 foreach ($tag_list as $tag_seqno => $tagblock) {
26     $tag= $tagblock['tag'];
27     $ext = '';
28     if (($tag == 6) || ($tag == 21) || ($tag == 35)) {
29         $ext = '.jpg';
30     }
31     if (($tag == 20) || ($tag == 36)) {
32         $ext = '.png';
33     }
34     if (($tag == 2) || ($tag == 22) || ($tag == 32)) {
35         if (empty($_REQUEST['noshape'])) {
36             $ext = '.shape';
37         }
38     }
39     if (empty($ext)) {
40         continue;
41     }
42
43     $name = $tagblock['tagName'];
44     $detail = $tagblock['detail'];
45     $detail_info = $tagblock['detail_info'];
46     if (isset($detail_info['image_id'])) {
47             $cid = $detail_info['image_id'];
48     } else {
49             $cid = $detail_info['shape_id'];
50     }
51     $image_filename = "$tmp_prefix$id-$cid$ext";
52
53     if ($ext == '.jpg') {
54         $image_data = $swf->getJpegData(intval($cid));
55     } elseif($ext == '.png') {
56         $image_data = $swf->getPNGData(intval($cid));
57     } else { // shape
58         $image_data = $swf->getShapeData(intval($cid));
59     }
60     if (! is_readable($image_filename)) {
61         file_put_contents($image_filename, $image_data);
62     }
63     echo "<tr>\n";
64     echo "<td> $name($tag) </td> ";
65     echo "<td> $cid (ext=$ext)</td>\n";
66
67     if (($ext == '.jpg') || ($ext == '.png')) {
68         echo "<td> <img src=\"./swfimage.php?id=$id&image_id=$cid&ext=$ext\"> </td>";
69     } elseif ($ext == '.shape') { // shape
70         echo "<td>
71 <object width='240' height='240'>
72 <param name='movie' value='./swfshape.php?id=$id&shape_id=$cid&ext=$ext'>
73 <embed src='./swfshape.php?id=$id&shape_id=$cid&ext=$ext' width='240' height='240'>
74 </embed>
75 </object>
76 </td>";
77     }
78     echo "</tr>\n";
79 }
80 echo "</table>\n";
81
82 ?>
83 </body>
84 </html>