Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6805123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:32:55+00:00 2026-05-26T19:32:55+00:00

I have a script on my server that dynamically creates images of chess diagrams:

  • 0

I have a script on my server that dynamically creates images of chess diagrams:

<img src = "ChessImager/ChessImager.php?fen=r3k2r/1pqb2pp/pnn2p2/4p3/4Q3/NBP1B3/P4PPP/R2R2K1&amp;square_size=45&amp;ds_color=(143,188,143)&amp;ls_color=(232,223,192)">

But the resulting image files are nearly 30k, too big. I want to use pngnq http://pngnq.sourceforge.net/ to shrink them. I present them in a slideshow at http://communitychessclub.com I want a new php script to create the images from ChessImager.php and pipe each of these diagram image files (~50) to a new filename like ‘game1234.png’ and I’ll batch pre-process (not real-time) them with pngnq. I have a file ‘Forsyth.csv’ which lists the data:

r1bqk2r/1p2bp1p/p2pnp2/4pN1Q/2B1P3/2N5/PP3PPP/R2R2K1|1256
r3k2r/1pqb2pp/pnn2p2/4p3/4Q3/NBP1B3/P4PPP/R2R2K1|1255
4rrk1/ppp3pp/2n4q/3p4/3P4/1NP1PpPP/PP3Q1K/R4R2|1253
rn2kb1r/1q1p2p1/p3p3/1p2N1Bp/2p1P2P/2P4Q/PP3PP1/3R1RK1|1252

I use this:

<?php $text = file('Forsyth.csv');foreach($text as $line) 
{$token = explode("|", $line); print "\n"; $fen = $token[0]; $game_num = $token[1];
$phrase="games/game$game_num.php"; echo "<li> <img 
src=\"ChessImager/ChessImager.php?fen=$fen&amp;square_size=45&amp;ds_color=(143,188,143)&amp;ls_color=(232,223,192)\" ></li>";} ?>

Any ideas?

Update: this is posted at http://communitychessclub.com/produce.php

<?php $text = file('Forsyth.csv'); foreach($text as $line) {$token = explode("|",
$line); print "\n"; $fen = $token[0]; $game_num = $token[1]; print "\n";
$goat = "diagrams/game$game_num.png"; 
$src="ChessImager/ChessImager.php?fen=$fen&amp;square_size=45&amp;ds_color=(143,188,143)&amp;ls_color=(232,223,192)";
echo "<li><img src = \"$src\"></li>";}
?>

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:32:56+00:00Added an answer on May 26, 2026 at 7:32 pm

    ChesssImager.php or one of its includes must have a imagepng($image) line near the end that sends the generated PNG image to the web browser. If your question is how to save that data to the disk instead, you can just modify the script so that it saves the image data instead:

    imagepng($image, $filename);
    

    where $filename is something unique that you can generate from the arguments passed to the script. For example:

    $filename = md5($fen).".png";
    

    Wherever you decide to have the script save the files, you’ll need to make sure that you (or the web server if you’re running it in a browser) has permission to write to that folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script that dynamically creates a HTML file. In command line,
I have written a CGI script that creates an image dynamically using GET data.
I have a batch script that dynamically creates some files and generates four files
I have written a script which dynamically creates a html table based off server
I have a server script that I need to pass data to from the
I have a script that connects to SQL Server 2005 default instance. But I'm
I have a script that listens to a jabber server and responds accordingly. Though
I have a simple PHP script that will either serve up a streaming ASF
I have a PHP script on a server <?php // retrieve POST vars $comment
I have a php mail script sitting on a LAMP vps server. The script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.