On Thu, 2005-05-05 at 07:44 -0400, Steve Brown wrote:
> getFrame.phpt test fails w/
> togdimage(): supplied resource is not a valid Image resource in /var/www/html/test/getFrame.php
>
> I saw an earlier post with this problem specific to BSD, but the
> remedy, cooking up my own php, isn't really appealing.
>
> The php imagecreatetruecolor function seems to work fine. Test also attached.
>
> I instrumented a few things and everything looks reasonable down through
> setting up the function return in toGDImage. ZEND_FETCH_RESOURCE, for some reason
> doesn't seem to agree, probably with the return_value arg and doesn't return.
>
> I'm running the stuff listed below with the cvs ffmpeg-php.
>
> I think this is a pretty vanilla setup.
>
> Any ideas?
>
> Steve
It looks like the call to ZEND_GET_RESOURCE_TYPE_ID to get the type id
for "gd" in register_ffmpeg_frame_class happens before "gd" gets
registered. So, it returns 0, probably an error.
I tossed in a couple of calls later on to be sure that le_gd really gets
set and things now seem to work.
There's probably a more elegant solution. A patch is attached.
Steve
|