Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 7th, 2008, 4:49 AM   #1
chicka2chubby
Newbie
 
Join Date: Nov 2007
Posts: 5
Rep Power: 0 chicka2chubby is on a distinguished road
Can I Use Cgi/Perl to Pile Up Picture?

Dear Viewers,
My English is very bad so please bear with my silly mistake. Im sorry if my words are rude.

I would like to know , can i use cgi/perl to combine @ pile up picture like this link below
http://www.ss.iij4u.or.jp/~somali/we...composite.html

they are using ImageMagick,so i would like to know whether the basic perl/cgi can do the same coding.

:: what i am trying to do for my final year project is, to put a mark ( small circle dot ) on a map to show the location system after we get the latitud & latitude from the data log ::

unfortunately, the mark always do not stay on the right place.

i hope anybody here could help me. Thank You
chicka2chubby is offline   Reply With Quote
Old Jan 7th, 2008, 8:39 AM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,722
Rep Power: 5 Sane is on a distinguished road
Re: Can I Use Cgi/Perl to Pile Up Picture?

Are you using ImageMagick for Perl?

If the mark does not always stay on the right place, you might be using PerlMagick incorrectly. Could you post your code?

If you do not want to use PerlMagick, you could use another image library (if one exists). Sorry. Basic Perl does not let you change images.

Last edited by Sane; Jan 7th, 2008 at 8:56 AM.
Sane is offline   Reply With Quote
Old Jan 7th, 2008, 9:12 PM   #3
chicka2chubby
Newbie
 
Join Date: Nov 2007
Posts: 5
Rep Power: 0 chicka2chubby is on a distinguished road
Re: Can I Use Cgi/Perl to Pile Up Picture?

this is the code

open FILE, ">>$file"; #ファイルへの書き込み
#flock (FILE, 2);
print (FILE "\"", $tizu);
print (FILE "\"\,\"", $ido);
print (FILE "\"\,\"", $keido);
print (FILE "\"\,\"", $jikan);
print (FILE "\"\,\"", $tate);
print (FILE "\"\,\"", $yoko);
print (FILE "\"\,\"", $wariai);
print (FILE "\"\n");
#flock (FILE, 8);
close FILE;

$view = "${tizu}.jpg";
print "Content-type: image/jpeg\n\n"; #HTMLファイルや画像ファイルは、サーバからデータを送信する際に情*の種類を示す(ブラウザに返すレスポンスの形式を指定)
open(IMG, "$view");
binmode (IMG);
binmode STDOUT;
print <IMG>;


$a = '1.gif';
print "Content-type: image/gif\n\n";
open(IMG, "$a");
binmode (IMG);
binmode STDOUT;
print <IMG>; #
close(IMG);

exit;

thank you for your help
chicka2chubby is offline   Reply With Quote
Old Jan 7th, 2008, 9:57 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,722
Rep Power: 5 Sane is on a distinguished road
Re: Can I Use Cgi/Perl to Pile Up Picture?

Oh. You are not using PerlMagick. Will you try it?

Have you considered overlaying the two images in HTML using CSS?

For example, to place the image "some_img.jpg" at coordinates (100, 150) on the website:

HTML Syntax (Toggle Plain Text)
  1. <img src="some_img.jpg" class="my_mark" />

CSS Syntax (Toggle Plain Text)
  1. img.my_mark {
  2. position: absolute;
  3. left: 100px;
  4. top: 150px;
  5. }

This may be simpler depending on your requirements.
Sane is offline   Reply With Quote
Old Jan 9th, 2008, 12:07 AM   #5
chicka2chubby
Newbie
 
Join Date: Nov 2007
Posts: 5
Rep Power: 0 chicka2chubby is on a distinguished road
Re: Can I Use Cgi/Perl to Pile Up Picture?

thanks sane.

i will try to do the overlaying things using CSS.

Can i ask you something,

what is the meaning of binmode ( binary mode ) and how to use it?

im doing this with 2 of my friends and they asked me to find that " can we overlay images using binary mode?" ??

thank you again. sorry
chicka2chubby is offline   Reply With Quote
Old Jan 9th, 2008, 11:09 AM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,722
Rep Power: 5 Sane is on a distinguished road
Re: Can I Use Cgi/Perl to Pile Up Picture?

binmode only changes the file handler from TEXT mode to BINARY mode. So that when you read/write a file, the file stream knows that it is Binary, and not Text.

Binary mode is necessary if you are reading/writing a file that is not text, such as an image. An image is binary, so you must use binmode to read it. Binmode can not be used to do or "make" anything.

In other words, you can not use binmode to overlay images. If you wrote your own image decoding algorithm to put the pixels together manually, you would need binmode to do that. This is what ImageMagick is meant to do for you. You do not want to rewrite something that complicated, especially if it has already been done for you.

Do not forget about the alternative of using PerlMagick, it may be more stable than relying on the browser to work correctly with CSS.
Sane is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need picture help RAzR Creations Visual Basic 3 May 21st, 2006 3:43 AM
cgi/perl script + IE problem joyceshee Perl 2 Jan 24th, 2006 11:10 AM
picture viewer JDStud6 HTML / XHTML / CSS 6 Nov 16th, 2005 9:33 PM
Upload Picture yip_kw_trowa PHP 3 Oct 14th, 2005 8:36 AM
Where does print screen keep the picture? Sane Coder's Corner Lounge 11 Sep 3rd, 2005 1:40 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC