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();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像