kepler has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Outputing image in perl script/cgi
by LanX (Saint) on Nov 08, 2015 at 12:04 UTC
    > My problem is that I also output html/text content.

    ???

    I suppose you are aware of the img tag and your problem is that the image data is generated dynamically.

    The classic answer is either to statically store the image or to link in the image src url to a second cgi call requesting the image.

    An alternative with "new" browsers is base64 encoding of an inlined image.

    (Not really a perl question)

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      Hi. I understand. But my image generates this: ÿØÿá :/ ...
        What is the question?

        What did you try?

        What did you get?

        What do you want to get?

        Please try to phrase posts which can be answered without semi telepathic guessing.

        It might probably and under some circumstances be (i.e. let's suppose) that you want to google for "base64 and perl" but I'm not going to do it for you if you don't even show any efforts in expressing your problem.

        Our maybe not? Who knows?

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Je suis Charlie!

        A reply falls below the community's threshold of quality. You may see it by logging in.
        If your image is generating high-bit characters, then you aren't encoding it in base64. MIME::Base64

        #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Re: Outputing image in perl script/cgi
by nikosv (Deacon) on Nov 08, 2015 at 19:49 UTC
    have you set STDOUT to binmode? binmode STDOUT
    have you use the right header ? header("image/png")
Re: Outputing image in perl script/cgi
by Anonymous Monk on Nov 08, 2015 at 21:37 UTC