RE: broadcast photo on other site not by up load

2002-12-23 Thread Peter Kappus
Season's greets, Eric  fellow Perlites:

Yes, chances are, if you're getting *something* but not an image, you're
either sending the wrong headers to the browser OR you're sending the right
headers and then getting a compilation error...Or both.  On a windows
machine, there's also the possibility that you're not using Binary mode on
your image file handles (but since you're doing it in linux for the time
being, that's one problem we won't have to worry about)

What I usually do when this happens, is right click (from NS6+ or Mozilla)
and do a view source on the image itself... in the source you'll see the
actual output of your script which will contain the error, if there is one.

Another good test, which I'm sure you've already done, is to makes sure that
when you type
% perl showphoto.pl
you're script actually compiles, and runs and then spews a bunch of binary
data to your terminal...(after printing Content-type: image/jpg\n\n (or
whatever))
I'd recommend this over redirecting you're output into a file because it
should tell you immediately if you're having compilation errors.

The other thing to do is make sure you're dying where appropriate... I
don't remember your original script but make sure you have things like:

open(IMAGE,myPic.jpg) or die(Couldn't open pic! $!);

(the $! will tell you what actual error occured... this way, if you've got
the wrong path or insufficient priviladges, etc. you'll find out the easy
way...

HTH  good luck!

-Peter




-Original Message-
From: zentara [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 22, 2002 4:54 AM
To: [EMAIL PROTECTED]
Subject: Re: broadcast photo on other site not by up load


On Sat, 21 Dec 2002 14:07:03 -0700, [EMAIL PROTECTED] (Eric Lin)
wrote:

   Now I am in linux again,
I did /usr/bin/perl  /usr/lib/cgi-bin/showphoto.pl  mytestout.jpg
then at netscape 7 's url type /home/fsshl/mytestout.jpg

it showed
---
The image file:///home/fsshl/mytestout.jpg cannot be displayed, 
because it contains errors

Make sure your showphoto.pl script is not outputting an html header.
Can you look at mytestout.jpg with somethong else like xv.
Look at mytestout.jpg with a hex editor and see what the first few lines
are. Are they a valid jpeg header? Compare it to other known good jpegs
you have.
Your showphoto.pl script should be able to read in a image and then
print it out without corrupting it. Post your showphoto.pl that you are
using.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: broadcast photo on other site not by up load

2002-12-22 Thread zentara
On Sat, 21 Dec 2002 14:07:03 -0700, [EMAIL PROTECTED] (Eric Lin)
wrote:

   Now I am in linux again,
I did /usr/bin/perl  /usr/lib/cgi-bin/showphoto.pl  mytestout.jpg
then at netscape 7 's url type /home/fsshl/mytestout.jpg

it showed
---
The image file:///home/fsshl/mytestout.jpg cannot be displayed, 
because it contains errors

Make sure your showphoto.pl script is not outputting an html header.
Can you look at mytestout.jpg with somethong else like xv.
Look at mytestout.jpg with a hex editor and see what the first few lines
are. Are they a valid jpeg header? Compare it to other known good jpegs
you have.
Your showphoto.pl script should be able to read in a image and then
print it out without corrupting it. Post your showphoto.pl that you are
using.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: broadcast photo on other site not by up load

2002-12-21 Thread zentara
On Fri, 13 Dec 2002 13:55:50 -0700, [EMAIL PROTECTED] (Eric) wrote:

Dear Zentara:

  I copy that piece of code and paste in my showphoto.pl in
C:\apache2\cgi-bin\
but it still not show any photo
attach my showphoto.pl
please help again

Sorry, but it's hard to say what exactly your problem is, especially
because I don't use windows and don't know the peculiarities of
your windows apache server.
My suggestion is to work thru it step by step, until you
see where the problem is.
The first step is to get your script to output the image to
it's STDOUT. In other words, you should be able to do
showphoto.pl  mytestout.jpg and you should get
a good photo out.
Then you want to put it in your cgi-bin and try to
see where apache is messing up outputting the
photo. 
It usually ends up being something very simple,
which you are overlooking.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: broadcast photo on other site not by up load

2002-12-21 Thread eric lin

Dear Zentara:

  Now I am in linux again,
I did /usr/bin/perl  /usr/lib/cgi-bin/showphoto.pl  mytestout.jpg
then at netscape 7 's url type /home/fsshl/mytestout.jpg

it showed
---
The image file:///home/fsshl/mytestout.jpg cannot be displayed, 
because it contains errors




some body in perl-app mailing list told me they have a code did success 
broadcast by  Mac OSX perl 5.6.0 (ugh)


as show photo on other's site without download or any bottom click's 
hyperlink, but it now is so common, my site's counting banner is one 
example, a lots lists in ebay aution-computer product aution bidding P4
are another example , otherwise they can not have so flexible graphic 
page design just rely on 6 photo upload in ebay.

regard Eric-drop me a note if you can discover how to





Sorry, but it's hard to say what exactly your problem is, especially
because I don't use windows and don't know the peculiarities of
your windows apache server.
My suggestion is to work thru it step by step, until you
see where the problem is.
The first step is to get your script to output the image to
it's STDOUT. In other words, you should be able to do
showphoto.pl  mytestout.jpg and you should get
a good photo out.
Then you want to put it in your cgi-bin and try to
see where apache is messing up outputting the
photo. 
It usually ends up being something very simple,
which you are overlooking.





--
Sincere Eric
www.linuxspice.com
linux pc for sale


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: broadcast photo on other site not by up load

2002-12-20 Thread eric
Dear Zentara:

  I copy that piece of code and paste in my showphoto.pl in
C:\apache2\cgi-bin\
but it still not show any photo
attach my showphoto.pl
please help again

Sincere Eric
www.linuxspice.com
linux/window pc for sale

 
 img src=http://www.linuxspice.com/cgi-bin/showphoto.pl; /Br

 ##
 #!/usr/bin/perl
 use strict;
 print(Content-type:  Image/jpg\n\n);

 local $/ = undef; # file slurp mode
 open(INFILE, /path/to/image.jpg);
 my $img = INFILE;
 close(INFILE);
 binmode STDOUT;
 print $img;
 exit;
 #

 If you put this in a script all of its own, then you can use it in an
 image tag when printing out your html like so:
 img src=http://yourdomain.com/cgi-bin/showphoto.pl;







 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





showphoto.pl
Description: Binary data
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]