Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 25-06-2011, 05:53   #121
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: imgkap - kap File Converter Tool

Gunther

I doesn't matter where you put your source file. Somewhere in your home directory is just fine. Just don't put it where you have to be root to enter the directory!

Your error is as if gcc can't see the header file declarations.
To start with simple things, your source file download may be corrupt.
I have added the file I use.
imgkap.c.zip.doc
Thomas
cagney is offline   Reply With Quote
Old 25-06-2011, 06:18   #122
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Re: imgkap - kap File Converter Tool

Thomas ...

first of all thanks for your help.
Quote:
Originally Posted by cagney View Post
It doesn't matter where you put your source file. Somewhere in your home directory is just fine. Just don't put it where you have to be root to enter the directory!
OK, understood.
Quote:
Your error is as if gcc can't see the header file declarations.
To start with simple things, your source file download may be corrupt.
I have added the file I use.
OK, tried your file. Seems to be another version as the line numbers are slightly different. But unfortunately I still get the same errors .
Quote:
imgkap.c: In function 'writeimgkap':
imgkap.c:1111: warning: incompatible implicit declaration of built-in function 'log2'
imgkap.c:1167: warning: incompatible implicit declaration of built-in function 'round'
imgkap.c: In function 'kaptoimg':
imgkap.c:1381: error: 'FI_COLOR_IS_RGB_COLOR' undeclared (first use in this function)
imgkap.c:1381: error: (Each undeclared identifier is reported only once
imgkap.c:1381: error: for each function it appears in.)
imgkap.c:1381: warning: assignment makes pointer from integer without a cast
imgkap.c: In function 'imgheadertokap':
imgkap.c:1582: error: 'FI_COLOR_IS_RGB_COLOR' undeclared (first use in this function)
imgkap.c:1582: warning: assignment makes pointer from integer without a cast
imgkap.c: In function 'imgtokap':
imgkap.c:1709: warning: incompatible implicit declaration of built-in function 'round'
Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 25-06-2011, 06:35   #123
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: imgkap - kap File Converter Tool

What comes to mind is that Lenny i pretty old, and uses an old version of gcc.
The function "round" conforms to
Quote:
CONFORMING TO
C99, POSIX.1-2001.
From "man round". Maybe there is a problem with how your gcc handles C99.
I have appended a version that tells gcc to compile to the C99 standard. Same name as last time but includes a small change in the headers.
Use the gcc command in the comment on line 7.
Worth a try.
Thomas
imgkap.c.zip.doc
cagney is offline   Reply With Quote
Old 25-06-2011, 06:56   #124
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Re: imgkap - kap File Converter Tool

Thomas ...

I guess you are on the right track ... .
I used your modified version with
Quote:
gcc -std=c99 imgkap.c -O3 -s -lfreeimage -o imgkap
and the first errors disappeared
Quote:
imgkap.c: In function 'kaptoimg':
imgkap.c:1386: warning: implicit declaration of function 'FreeImage_AllocateEx'
imgkap.c:1386: error: 'FI_COLOR_IS_RGB_COLOR' undeclared (first use in this function)
imgkap.c:1386: error: (Each undeclared identifier is reported only once
imgkap.c:1386: error: for each function it appears in.)
imgkap.c:1386: warning: assignment makes pointer from integer without a cast
imgkap.c: In function 'imgheadertokap':
imgkap.c:1587: error: 'FI_COLOR_IS_RGB_COLOR' undeclared (first use in this function)
imgkap.c:1587: warning: assignment makes pointer from integer without a cast
Unfortunately there are still some left ... .

But hopefully this will give you another idea what's too old ... ?

Thanks
Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 25-06-2011, 07:50   #125
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: imgkap - kap File Converter Tool

Hm...

Quote:
'FI_COLOR_IS_RGB_COLOR' undeclared
But FI_COLOR_IS_RGB_COLOR is included in FreeImage.h, which you are supposed to have on your box.
What is your output from
Quote:
$locate FreeImage.h
If you have no output at all try
Quote:
$updatedb
to update the locate database, this takes a while. then try the locate command again.

Thomas
cagney is offline   Reply With Quote
Old 25-06-2011, 08:06   #126
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by cagney View Post
But FI_COLOR_IS_RGB_COLOR is included in FreeImage.h, which you are supposed to have on your box.
What is your output from


If you have no output at all try

to update the locate database, this takes a while. then try the locate command again.
Well ...,
first output was
Quote:
-bash: locate: command not found
Then I reinstalled mlocate and updated the DB. After that locate FreeImage.h output
Quote:
/usr/include/FreeImage.h
Trying to compile ends up with the same errors as before ...

Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 25-06-2011, 08:35   #127
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: imgkap - kap File Converter Tool

OK let's see where we end up with a bit of "cheating"!

Replace
Quote:
FI_COLOR_IS_RGB_COLOR
with
Quote:
0x00
in 2 places, lines 1386 and1587.
Save and recompile.

Thomas

PS, If you search the file "/usr/include/FreeImage.h " for "FI_COLOR_IS_RGB_COLOR" .....do you find anything?
cagney is offline   Reply With Quote
Old 25-06-2011, 08:43   #128
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by cagney View Post
OK let's see where we end up with a bit of "cheating"!

Replace
with

in 2 places, lines 1386 and1587.
Save and recompile.
OK, done.

Tried
Quote:
gcc -std=c99 imgkap.c -O3 -s -lfreeimage -o imgkap
ended up with
Code:
imgkap.c: In function 'kaptoimg':
imgkap.c:1386: warning: implicit declaration of function 'FreeImage_AllocateEx'
imgkap.c:1386: warning: assignment makes pointer from integer without a cast
imgkap.c: In function 'imgheadertokap':
imgkap.c:1587: warning: assignment makes pointer from integer without a cast
/tmp/ccx3Jd4d.o: In function `kaptoimg':
imgkap.c:(.text+0x2933): undefined reference to `FreeImage_AllocateEx'
/tmp/ccx3Jd4d.o: In function `imgheadertokap':
imgkap.c:(.text+0x692a): undefined reference to `FreeImage_AllocateEx'
collect2: ld returned 1 exit status
Thomas, could it be that I need the latest (or at least a newer) version of FreeImage?

Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 25-06-2011, 09:11   #129
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: imgkap - kap File Converter Tool

Yes! I was looking into that.
Did you see the ps in my last post?
Lenny is on version 3.10 from late 2007.
I have 3.13-something and the latest available is 3.15.
You can try, but in the worst case scenario you end up with a mess of dependencies.
Try to download and install a package from a later Debian version.
and then,
Quote:
sudo gdebi <downloaded_file.deb>
It is better to use "gdebi" than "dpgk" as it takes care of dependencies, as far as possible ......

Thomas
cagney is offline   Reply With Quote
Old 25-06-2011, 09:28   #130
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by cagney View Post
Yes! I was looking into that.
Did you see the ps in my last post?
Lenny is on version 3.10 from late 2007.
I have 3.13-something and the latest available is 3.15.
You can try, but in the worst case scenario you end up with a mess of dependencies.
Try to download and install a package from a later Debian version.
and then,


It is better to use "gdebi" than "dpgk" as it takes care of dependencies, as far as possible ......
Hmmm ..., now it becomes critical.
As I really have no idea of Linux I do not want to risk destroying my server installation (as it is a lot of work to get it running like it actually does as I have about 20 different domains hosted there).

But anyway - many thanks for your help and efforts Thomas.

Do you know another script for this purpose?
Extracting the text header from a kap file can simply be done by PHP. But I didn't managed to write the binary part to a working image (tif) file.

Thanks
Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 25-06-2011, 09:37   #131
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: imgkap - kap File Converter Tool

I agree, not worth the risk on a "production server".

Whats wrong with "bsb2tiff" from libbsb?

Thomas
cagney is offline   Reply With Quote
Old 25-06-2011, 09:43   #132
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Re: imgkap - kap File Converter Tool

Thomas ...
Quote:
Originally Posted by cagney View Post
Whats wrong with "bsb2tiff" from libbsb?
That I have to build them ...

Or is there a more simple way than the one described in the README?

Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 25-06-2011, 09:56   #133
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: imgkap - kap File Converter Tool

The simplest thing to try is the i386 deb package on this page libBSB | Official OpenCPN Homepage
cagney is offline   Reply With Quote
Old 25-06-2011, 10:06   #134
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Re: imgkap - kap File Converter Tool

Thomas ...
Quote:
Originally Posted by cagney View Post
The simplest thing to try is the i386 deb package on this page libBSB | Official OpenCPN Homepage
sorry - I am somewhat confused today
I have it already installed on the server

And I think the best would be to use bsb2png.
So let's see if I can manage to write a working script ...

Once again many thanks for your help.

Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 02-07-2011, 03:45   #135
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: imgkap - kap File Converter Tool

MdJ

A bug report.
A thing I noticed while fiddling with the NGA files.
"imgkap" is not respecting all the values in a supplied header file (you call that a kap file).
For example the line
Quote:
CED/SE=1994,RE=19,ED=12/17/1994
is changed around to
Quote:
CED/SE=1994,RE=19,ED=02/07/2011
That is, imgkap is inserting todays date, and in the wrong US format.
Todays date is 07/02/2011 in US format - don't blame me for the logic, but that is the convention.
So when the user is suppling the header file, just copy the values, please.

Thomas
cagney is offline   Reply With Quote
Reply

Tags
imgkap


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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Development Debugging Environment - Setup Help rgleason OpenCPN 654 04-10-2020 05:37
OpenCPN Beta Version 3.1.814 Released bdbcat OpenCPN 185 14-09-2012 07:43
Route File Transfer via SDcard to Garmin 441s four winds Navigation 11 25-02-2012 08:34
GRIB Weather Mark Ward OpenCPN 26 12-02-2012 21:33
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31

Advertise Here


All times are GMT -7. The time now is 04:38.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.