A
Asterbing
Hello,
I would like to display a serial of tiny images (as the one here in $img
of 55 bytes) from RAM, without to go through any temporary disk file
(unless if possible to create a ramdisk with some lines of Perl ;-)).
So, I've tried this :
#!/usr/bin/perl -T
use strict;
use warnings;
my $img = pack("C*", 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x08, 0x00,
0x08, 0x00, 0x91, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA6, 0xCA, 0xF0, 0x2A,
0x5F, 0xFF, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
0x08, 0x00, 0x00, 0x02, 0x10, 0x8C, 0x7F, 0xA2, 0x3B, 0xB1, 0xEC, 0x9E,
0x68, 0x72, 0xC6, 0x47, 0x65, 0x1B, 0xBC, 0x8F, 0x02, 0x00, 0x3B);
print "Content-type: text/html\n\n";
print "<p>This is an image :</p>";
print $img;
print "<p>That's all !</p>";
exit 0;
If I remove the "... This is an image ..." line, the image is well shown
in browser, but the last line of text is ignored.
If I let the "... This is an image ..." line, I get the sentence,
then the image content as text and the last line "That's all".
Maybe ideal would be to go through something like "print <img
src="display_image_value.cgi"></img>"; with POSted image (while
impossible to pass image data through GET in url itself), but how to
"simulate" a POST without any form and its action ?
Am I on the wrong way(s) ? How to do ?
I would like to display a serial of tiny images (as the one here in $img
of 55 bytes) from RAM, without to go through any temporary disk file
(unless if possible to create a ramdisk with some lines of Perl ;-)).
So, I've tried this :
#!/usr/bin/perl -T
use strict;
use warnings;
my $img = pack("C*", 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x08, 0x00,
0x08, 0x00, 0x91, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA6, 0xCA, 0xF0, 0x2A,
0x5F, 0xFF, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
0x08, 0x00, 0x00, 0x02, 0x10, 0x8C, 0x7F, 0xA2, 0x3B, 0xB1, 0xEC, 0x9E,
0x68, 0x72, 0xC6, 0x47, 0x65, 0x1B, 0xBC, 0x8F, 0x02, 0x00, 0x3B);
print "Content-type: text/html\n\n";
print "<p>This is an image :</p>";
print $img;
print "<p>That's all !</p>";
exit 0;
If I remove the "... This is an image ..." line, the image is well shown
in browser, but the last line of text is ignored.
If I let the "... This is an image ..." line, I get the sentence,
then the image content as text and the last line "That's all".
Maybe ideal would be to go through something like "print <img
src="display_image_value.cgi"></img>"; with POSted image (while
impossible to pass image data through GET in url itself), but how to
"simulate" a POST without any form and its action ?
Am I on the wrong way(s) ? How to do ?