in reply to Broken image link when calling CGI from img tag

If you look at the generated HTML, is the URL in the <img ...> tag correct?
indicating that perhaps the page is displaying before the image is generated.

If that's the case, it's an easy fix: generate the image before printing the HTML that contains the img tag.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Broken image link when calling CGI from img tag
by lintunen (Novice) on Jul 14, 2010 at 09:00 UTC
    The <img> tag seems fine. I'm not much of a Perl programmer, just adminning the application so with the information I've provided on how the script works, what techniques would I need to use so that the image is generated before the HTML is displayed?
      what techniques would I need to use so that the image is generated before the HTML is displayed?

      Make sure that the code for the image generation is run before the code that displays the HTML (and that it's not run in the background).

      Sorry, but without more knwoledge of the structure of your code it's impossible to give more concrete instructions.

      Perl 6 - links to (nearly) everything that is Perl 6.

        I was hoping there would be some generic guidelines on how to handle dynamic image generation and img tags but anyway, in short after the image is generated by an external process the script that generates the image contains the following code:

        if (-e $IMAGEFILE) { print $query->redirect($IMAGEFILE); exit; }

        And as mentioned previously, the perl script is called via an img tag.