Please turn on javascript in your browser to play chess.
Developers Forum

Developers Forum

  1. Standard member thire
    Xebite
    24 Oct '04 17:02
    I am looking for a possibility to create animated gif-pictures with php on the fly. (I am dreaming of creating a gif with all moves of a chessgame just from it's pgn or all it's FENs.)
    So google told me that there is a Imagemagic-module for PHP at http://pecl.php.net/package/imagick to create animated gifs. Basicly I can use exec('command' to execute a commandline command and create with imagemagic gifs from the commandline.
    Or I use the package from http://hyvatti.iki.fi/~jaakko/sw/ But my problem here is that I have no idea how to install or use it or what additional software is required.
    If anybody can help me here - would be kind!
    th
  2. Standard member thire
    Xebite
    28 Oct '04 13:40
    I tried to work on my little script and the actual situation is the follwoing:

    It scans a RHP-game's FENs just from knowing the gameid.
    It creates for each FEN a picture of this board.
    It calls ImageMagick to put all these pictures together into one animated gif-file.

    But there is a little problem: The server where I host my webspace is running PHP in safe_mode, which means that I can just execute commands (by using the php-funtion command(), system() or exec(), ...) which are in the safe_mode_exec_dir.
    My question: Can anyboady tell me how to find out where ImageMagick and it's 'convert'command is installed? But I fear it woun't let me do that anyway...

    I tried the command on the commandline (ssh-connection), and everything's fine (see the fool's mate here: http://fsmat.htu.tuwien.ac.at/~thire/web/chess/games/Mygame1.gif )

    Perhaps you know a workaround, perhaps you can host my scipt on your server or you know another solution (ever tried the pear-package of imagemagick?)...
    thanks,
    th
  3. 30 Oct '04 21:39
    Hey, thire, that's really cool. I suspect tho', that a gif for a normal game would be a bit too bit to download!

    Nonetheless, I'll see if I can remember to ask some of the real geeks at work if they know the answers to your questions.
  4. Standard member thire
    Xebite
    31 Oct '04 23:26
    thank you Roland, help is VERY appreciated...
    I found out that Imagemagick's "convert" command is in the directory "/usr/bin/convert" ("type convert" told me that) and my safe_mode_exec_dir is " /bin:/usr/bin" so this should be okay (or not?).
    If you want I can post links to my phpinfo() and give you all the source of my script.
    If I add the 2nd parameter for exec() I get "127" back, which (s.o. told me, not _very_ sure) means that the command could not be found. And with a third arguments, I get an empty array.
    any help? pretty pretty please...
    th
  5. 01 Nov '04 12:50
    Hey Thire, I'm afraid I don't know anything about PHP. It looks good though! What interests me is how you querey the site for informtation. I'll be looking to make my Java app auto-sychronise with RHP sometime so would be interesting in seeing how you've done this...
  6. Standard member thire
    Xebite
    02 Nov '04 11:39
    I grab all the FENs of a game from the boardhistory.php. I look for where it starts and where it ends and that's it. If you want, I can send you the 4 lines of php-Code. Very easy... Send me a PM with your email-adress.
    th