donglingsai2880 2013-08-01 14:30
浏览 42
已采纳

gzuncompress无法在Wordpress中运行

I'm trying to create a Wordpress site where I can place SWF files ready for QC, and I would like SWF header information displayed beside the banner.

I'm using this PHP Class

EDIT: (Code can also be found here).

It works fine out of the box and stand alone, however when I'm trying to using on a custom post type in wordpress, it gets to a call to gzuncompress and stops.

And I can't figure out why I can't use gzuncompress within wordpress.

DEBUG: Data values initialized
DEBUG: Opened http://localhost:8888/previewer/wp-content/uploads/2013/08/test.swf
DEBUG: Read MAGIC signature: CWS
DEBUG: Read VERSION: 9
DEBUG: Partial SIZE read: 177
DEBUG: Partial SIZE read: 2560
DEBUG: Partial SIZE read: 65536
DEBUG: Partial SIZE read: 0
DEBUG: Total SIZE: 68273
We need to uncompress this
This didn't uncompress
DEBUG: RECT field size: 0 bits
DEBUG: RECT binary value: (0)
DEBUG: RECT binary value: (0)
DEBUG: RECT binary value: (0)
DEBUG: RECT binary value: (0)
DEBUG: Frame rate: 0.0
DEBUG: Frames: 0
DEBUG: Finished processing http://localhost:8888/previewer/wp-content/uploads/2013/08/test.swf

Where as if I create a index.php with:

<?php

    require ("swfheader.class.edit.php") ;
    $header = "test.swf";

$swf = new swfheader(true) ;
    // Open the swf file...
    // Replace filename accordingly to your test environment...
    $swf->loadswf($header) ;
    // Show data as a block... you can also access data within the object
    $swf->show() ;
?>

My output is the following:

DEBUG: Data values initialized
DEBUG: Opened test.swf
DEBUG: Read MAGIC signature: CWS
DEBUG: Read VERSION: 9
DEBUG: Partial SIZE read: 164
DEBUG: Partial SIZE read: 3840
DEBUG: Partial SIZE read: 65536
DEBUG: Partial SIZE read: 0
DEBUG: Total SIZE: 69540
We need to uncompress this
Uncompressing....
DEBUG: RECT field size: 14 bits
DEBUG: RECT binary value: 00000000000000 (0)
DEBUG: RECT binary value: 01011101110000 (300)
DEBUG: RECT binary value: 00000000000000 (0)
DEBUG: RECT binary value: 01001110001000 (250)
DEBUG: Frame rate: 24.0
DEBUG: Frames: 1
DEBUG: Finished processing test.swf

The code seems to fall down when it gets to the gzuncompress.


From what I've managed to narrow down, is that I cannot use a URL with gzuncompress, so I need a way of working around this. :/

  • 写回答

1条回答 默认 最新

  • dousi1875 2013-08-02 11:31
    关注

    Sending a HTTP URL into gzuncompress would not work, as it doesn't allow remote files.

    The result is that I took the $website_url and removed that from the $swf_file_location using str_replace and ran that through the swfheader.class.php

    $website_url = "http://example.com/";
    $swf_file = "http://example.com/test_file.swf";
    
    $swf_test = str_replace($website_url, "", $swf_file);
    
    $swf->loadswf($swf_test) ;
    
    $swf->show();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于作物生长模型下,有限水资源的最大化粮食产量的资源优化模型建立
  • ¥20 关于变压器的具体案例分析
  • ¥15 生成的QRCode圖片加上下載按鈕
  • ¥15 板材切割优化算法,数学建模,python,lingo
  • ¥15 科来模拟ARP欺骗困惑求解
  • ¥100 iOS开发关于快捷指令截屏后如何将截屏(或从截屏中提取出的文本)回传给本应用并打开指定页面
  • ¥15 unity连接Sqlserver
  • ¥15 图中这种约束条件lingo该怎么表示出来
  • ¥15 VSCode里的Prettier如何实现等式赋值后的对齐效果?
  • ¥20 keepalive配置业务服务双机单活的方法。业务服务一定是要双机单活的方式