svnno****@sourc*****
svnno****@sourc*****
2009年 2月 11日 (水) 21:32:46 JST
Revision: 113 http://svn.sourceforge.jp/view?root=swfed&view=rev&rev=113 Author: yoya Date: 2009-02-11 21:32:46 +0900 (Wed, 11 Feb 2009) Log Message: ----------- GIF 対応 Modified Paths: -------------- trunk/www/swfimagereplace.php -------------- next part -------------- Modified: trunk/www/swfimagereplace.php =================================================================== --- trunk/www/swfimagereplace.php 2009-02-11 06:14:34 UTC (rev 112) +++ trunk/www/swfimagereplace.php 2009-02-11 12:32:46 UTC (rev 113) @@ -55,6 +55,7 @@ <input type="hidden" name="image_id" value="$image_id" /> <input type="submit" name="ext" value=".png" /> <input type="submit" name="ext" value=".jpg" /> + <input type="submit" name="ext" value=".gif" /> </form> ファイルを指定してください。(64MBytes 以内に限定してます) </body> @@ -67,7 +68,8 @@ $image_id = $_REQUEST['image_id']; $id_image = $_REQUEST['id_image']; $ext = $_REQUEST['ext']; -if (($ext != '.png') && ($ext != '.jpg')) { +if (($ext != '.png') && ($ext != '.jpg') && ($ext != '.gif')) { + echo "unknown ext($ext)\n"; exit(1); } $swf_filename = "$tmp_prefix$id.swf"; @@ -78,10 +80,19 @@ $swf = new SWFEditor(); $swf->input($swfdata); -if ($ext == '.jpg') { +switch ($ext) { + case '.jpg': $swf->replaceJpegData(intval($image_id), $imagedata); -} else { + break; + case '.png': $swf->replacePNGData(intval($image_id), $imagedata); + break; + case '.gif': + $swf->replaceGIFData(intval($image_id), $imagedata); + break; + default: + echo "unknown ext($ext)\n"; + exit(1); } header('Content-type: application/x-shockwave-flash');