svnno****@sourc*****
svnno****@sourc*****
2009年 2月 10日 (火) 01:56:09 JST
Revision: 107 http://svn.sourceforge.jp/view?root=swfed&view=rev&rev=107 Author: yoya Date: 2009-02-10 01:56:08 +0900 (Tue, 10 Feb 2009) Log Message: ----------- SWF 内画像の GIF 差し替えコマンドツール Added Paths: ----------- trunk/sample/swfreplacegifdata.phps -------------- next part -------------- Added: trunk/sample/swfreplacegifdata.phps =================================================================== --- trunk/sample/swfreplacegifdata.phps (rev 0) +++ trunk/sample/swfreplacegifdata.phps 2009-02-09 16:56:08 UTC (rev 107) @@ -0,0 +1,27 @@ +<?php + +if (($argc < 4) || ($argc%2 != 0)) { + fprintf(STDERR, "Usage: swfreplacegifdata <swf_file> <image_id> <gif_file> [<image_id2> <gif_file2> [...]]\n"); + exit(1); +} + +$swf_filename = $argv[1]; + +$swfdata = file_get_contents($swf_filename); +$obj = new SWFEditor(); +if ($obj->input($swfdata) == false) { + fprintf(STDERR, "input failed\n"); + exit (1); +} + +for ($i=2 ; $i < $argc ; $i+=2) { + $image_id = $argv[$i]; + $gif_filename = $argv[$i+1]; + $gifdata = file_get_contents($gif_filename); + if ($obj->replaceGIFData($image_id, $gifdata) == false) { + fprintf(STDERR, "replaceGIFdata($image_id, ...) failed\n"); + exit (1); + } +} + +echo $obj->output();