Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 2nd, 2001, 01:23 AM
Dups Dups is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 30 Dups User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Hello there,
I am finding it difficult to produce images.
I am using perl and html.

Should I give a different html header when i have to display an image.
At present I give the header
"content-type:text/html"

Please help
Thank u
Dups

Reply With Quote
  #2  
Old March 2nd, 2001, 10:19 AM
dsb dsb is offline
PerlGuy
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Posts: 714 dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 15 h 44 m 20 sec
Reputation Power: 36
Send a message via AIM to dsb
Wink

Could you be a little more specific. For example, show some of your code. The problem could be elsewhere and you are just missing it.

__________________
- dsb -
Perl Guy

Reply With Quote
  #3  
Old March 2nd, 2001, 03:40 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 9
I assume you mean opening and printing an image with perl
Code:
$file = '/path/to/image.jpg';

print "Content-type: image/jpeg\n\n";

open(A,$file) or die($!); # Die statement wont do much in an image
	while( <A> ) {
		print;
	}
close(A);

You can't print an image and html with the same script call. You'd have to make your html output page make an <img src> call to a perl script that will just print the image content type and the image.

Reply With Quote
  #4  
Old March 5th, 2001, 12:09 AM
Dups Dups is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 30 Dups User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Hello there,

I am sorry, I didn't explain my problem clearly.

In my perl script, I am using the following html code.

<IMG SRC="31a.jpg" ALT="image" ALIGN=TOP>jpeg

Then in my browser I can't see the image. But I can see
an icon named "image" instead.

If I set a background image as follows
<body background="31a.jpg">

The background will be my default setting and my background image is not seen.
What could be the problem? Please help.
Thank u
Dups

Reply With Quote
  #5  
Old March 5th, 2001, 01:58 AM
suchitra suchitra is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 0 suchitra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool

Hello,
Image named 31a.jpg might not be existing in the same path where your perl script is running or you might have given wrong path as source of image i.e., the reason alternate text is displaying.

Here is the simple code if your image is on the desktop,

#!/usr/bin/perl
print "Content-type:text/html\n\n";

print qq~
<html><body bgcolor="#ffffff" text="#000000" id=all>
<IMG SRC="c:\\windows\\desktop\\31a.jpg" ALT="image" ALIGN=TOP>
</body></html>
~;






Reply With Quote
  #6  
Old March 5th, 2001, 11:14 PM
Dups Dups is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 30 Dups User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Hello there,
I gave the full path. Still there was no change. Should I
make anychanges in the settings of my netscape browser?
Thank u
Dups

Reply With Quote
  #7  
Old March 6th, 2001, 09:07 AM
randor randor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Western New York
Posts: 85 randor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 8 m 46 sec
Reputation Power: 8
Send a message via Yahoo to randor
this is just a guess, but, if you do have your images in your cgi-bin, alot of times that is not allowed in cgi.. hence they will not show up.. so that might be the source of your trouble, if so, remove them from your cgi-bin, place them in your public_html folder(via uploading in binary)then place the full path to the public_html directory in your html..

Reply With Quote
  #8  
Old March 6th, 2001, 12:01 PM
Sonis Sonis is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Lithuania
Posts: 7 Sonis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
look at page source code

look at page source code in your Netscape, is it right?

Reply With Quote
  #9  
Old March 6th, 2001, 11:30 PM
suchitra suchitra is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 0 suchitra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello,
Yes,Browser settings may be the problem.
just check your netscape browser settings for gif and jpeg
type images are enabled or not.
You can do it using Edit -> preferences ->Navigator -> Applications.

bye

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > showing images using html and perl


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway