image file data arrays/HTML -- any sagely advice?

image file data arrays/HTML -- any sagely advice?

am 15.11.2005 22:17:32 von Todd Morrison

Hey Everyone,

I am writing a .pl that will grab an image and store it in an array, i.e.

open (GIFFILE, $filename)

binmode (GIFFILE);

@fileData = ;

close (GIFFILE)

Is there a way to "print" the array to an HTML document (i.e. display the
image), at any trivial point in the HTML document's body? Any
advice/pointers would be super-appreciated.

Thanks!

Todd



_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: image file data arrays/HTML -- any sagely advice?

am 15.11.2005 23:44:18 von dbecoll

Todd Morrison wrote:

> Hey Everyone,
>
> I am writing a .pl that will grab an image and store it in an array, i.e.
>
> open (GIFFILE, $filename)
>
> binmode (GIFFILE);
>
> @fileData = ;
>
> close (GIFFILE)
>
> Is there a way to "print" the array to an HTML document (i.e. display the
> image), at any trivial point in the HTML document's body? Any
> advice/pointers would be super-appreciated.

Why not just send back an IMG tag that points to the GIF ?

You need a clearer desc. of the problem at hand.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: image file data arrays/HTML -- any sagely advice?

am 16.11.2005 00:44:12 von Perl Developer

-----Original Message-----
From: Todd Morrison [mailto:reptile@uwo.ca]
Sent: Tuesday, November 15, 2005 3:18 PM
To: activeperl@listserv.ActiveState.com
Subject: image file data arrays/HTML -- any sagely advice?

Hey Everyone,

I am writing a .pl that will grab an image and store it in an array, i.e.

open (GIFFILE, $filename)

binmode (GIFFILE);

@fileData = ;

close (GIFFILE)

Is there a way to "print" the array to an HTML document (i.e. display the
image), at any trivial point in the HTML document's body? Any
advice/pointers would be super-appreciated.

Thanks!

Todd

---------- snip -----------------
HTML doesn't actually contain images, as opposed to something like a MS Word
document. If you go to a web page with 10 images, you actually do 11
requests (1 for the page text itself and one for each image). If you save
an HTML document to disk via IE or Word, you will see a text file and a
folder containing all of the images, stylesheets, javascript files, etc. So
there is no way to do it truly in line.

You can, however, create a cgi application that gets a request and servers
an image, rather than having a link directly to a file location. For
example, you might see something like:

http://www.somesite.com/cgi-bin/getImage.cgi?filename=image. gif

inline in an HTML document. But, again, it is not imbedded in the HTML
document. The only exception that I know of is HTML mail, but that is
another story.

Does this answer the question / render it moot, or have I completely
misunderstood the question?

Chris Snyder



_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: image file data arrays/HTML -- any sagely advice?

am 16.11.2005 01:21:44 von Petr Vileta

Todd Morrison wrote:
> Hey Everyone,
>
> I am writing a .pl that will grab an image and store it in an array,
> i.e.
> open (GIFFILE, $filename)
>
> binmode (GIFFILE);
>
> @fileData = ;
>
> close (GIFFILE)
>
> Is there a way to "print" the array to an HTML document (i.e. display
> the image), at any trivial point in the HTML document's body? Any
> advice/pointers would be super-appreciated.
>

This is very simple. Script for grabing image

----CUT----
# image.pl
my $filename = 'c:/pictures/someimage.gif';
open GIF, $filename;
binmode GIF;
my $image = ;
close GIF;
# here is the trick how to send image to internet
print "Accept-Ranges: bytes\n",
"Content-Length: ", length($image), "\n",
"Connection: close\n",
"Content-Type: image/gif\n\n",
$image;
----CUT----

And in the html page you will write this



It's all :-)

Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)



_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: image file data arrays/HTML -- any sagely advice?

am 16.11.2005 01:27:06 von Petr Vileta

$Bill Luebkert wrote:
> Todd Morrison wrote:
>
>> Hey Everyone,
>>
>> I am writing a .pl that will grab an image and store it in an array,
>> i.e.
>>
>> open (GIFFILE, $filename)
>>
>> binmode (GIFFILE);
>>
>> @fileData = ;
>>
>> close (GIFFILE)
>>
>> Is there a way to "print" the array to an HTML document (i.e.
>> display the image), at any trivial point in the HTML document's
>> body? Any advice/pointers would be super-appreciated.
>
> Why not just send back an IMG tag that points to the GIF ?
>
Maybe he want to do something like this



:-)

Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)



_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs