The Navigatrix has been updated. The new website can be found at navigatrix.net.




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Problem with tif2bsb usage

Joined: 19 Jun 2012, 04:29
Posts: 50
Please assist cause there are lack of info regarding the problem i've encountered with!

Upon try to create .kap file for OpenCPN following the procedure described here, met following problem on leg of using the tif2bsb:
Code:
No support for TIFF files with PHOTOMETRIC=2 (only images containing color maps supported)

I've tried to follow steps described here, so i add -type Palette in line when create .tif file in such a way:
Code:
convert /home/andrey/Charts/maps_jpeg_wthai/phu_semi_200000.jpg -colors 127 -type Palette phu.tif

as well as separately for .tif as for all - .gif, .tif, and .png files but any way fail

Please advise what's wrong
RGRDS


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 19 Jun 2012, 04:29
Posts: 50
I've stopped on final step to create .kap file with notice in terminal:
Code:
andrey@andrey-laptop:~$ tif2bsb -c 4 PHU.hdr phu.tif phu.kap
No support for TIFF files with PHOTOMETRIC=2 (only images containing color maps supported)


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 04 Nov 2010, 20:51
Posts: 1062
Try using the script:

Chart Converter (Ray> Graphics> Chart Converter) which automates the process you're trying and places an image ready for geo-referencing on your Desktop.....

See if that chokes.


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 19 Jun 2012, 04:29
Posts: 50
Dear Moe,
thanks for your last, but please clarify where should i use command you provide? Terminal Emulator? Didn't understand what script you mean.
rgrds


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 04 Nov 2010, 20:51
Posts: 1062
In the lower left is the Menu icon....the Ray. Click on the Ray; slide up to Graphics; slide over to the popout submenu and select Chart Converter (Ray> Graphics> Chart Converter).

This calls up a script which semi-automates the process you're trying and places an image ready for geo-referencing on your Desktop.

Seaclear Calibration opens and you point it to the image on the Desktop (chart.png). Place your points and do everything you need to create the essential info.

Close the program and the script continues to convert the freshly geo-referenced files into a .kap. They are placed in /home/Charts/kap for easy inclusion into Opencpn.

Try this process to see if it still quits. Unfortunately the only error you will get is that it didn't work (no file in /home/Charts/kap). If you ran the script from the terminal (makekap) you would get a more detail error, but you will also get a lot of garbage that you would have to sift through.

The tail part looks like this:
Code:
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 2 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 1 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 2 is not valid, number of bitmaps in imagelist: 0
Create CHART.hdr
No support for TIFF files with PHOTOMETRIC=1 (only images containing color maps supported)
err:ntdll:RtlDeleteResource Deleting active MRSW lock (0x112494), expect failure



Give it a go, and see it it works. If it doesn't there is a simple fix...I just don't remember what it is off hand.


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 19 Jun 2012, 04:29
Posts: 50
Moe, i did follow exactly way you show (sorry for misunderstand on beginning). But SeaClear can not, as i understood from here, generate .kap files but only .wcl and all for this it is useful in our case is to create a header .hdr to transform it in .kap with string tif2bsb in terminal and the problem is encountered exact in this step.
Please, correct me if i have been wrong in steps above.

As it seems to me the key point for my case is to find out how to realize this:
Quote:
Close the program and the script continues to convert the freshly geo-referenced files into a .kap. They are placed in /home/Charts/kap for easy inclusion into Opencpn.

cause when i close SeaClear script, after creation of .hdr file, there is nothing in /home/andrey/Chatrs/kap folder.

rgrds,
Andrey


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 04 Nov 2010, 20:51
Posts: 1062
Yes it is correct that Seaclear only created headers and not some_chart.kap. All the moving bits of the script Chart Maker are not visible. It's not exactly like "laws"and "sausages" in that it might turn your stomach if you know how they are really made...in this case the process can be transparent.

...unless the process doesn't spit the finished treat out the end; then we have to go look at "why"

The honest answer is "I don't know"....

I did figure out a work-around, but in trying to replicate the problem I learned more than anyone should know about image formats, but this is still not enough to give a informed answer....except tib2bsb chokes on more than 127 colours.

This is made worse by running a number of image file formats through the Chart Converter and they all worked. You posted that you started with a JPG. I tried a number of colour densities and the script never missed a beat.

...although, come to think of it, I never tried a 8,16,32, or 64 colour JPGs. They all had a gazillion colours. The script (with convert did what it was suppose to do and kept the colours trimmed to 127.

However, strange things happened when I took a GIF extracted from a PDF file.

It starts out 4 coloured. (Yes, that's "Mostly Black" and three shades of white.)
Attachment:
4_colour_gif.png
4_colour_gif.png [ 19.63 KiB | Viewed 16579 times ]

convert tonga1.gif -colors 127 tonga_chart1.png

The PNG becomes 256 rainbow-licious colours. Red is the second colour.
Attachment:
256_coloured_png.png
256_coloured_png.png [ 30.39 KiB | Viewed 16579 times ]


convert tonga_chart1.png -colors 127 tonga_chart1.gif

It becomes a differnent 4 colour dreary.
Attachment:
4diff_colour_gif.png
4diff_colour_gif.png [ 6.19 KiB | Viewed 16579 times ]

convert tonga_chart1.gif -colors 127 tonga_chart1.tif

This becomes 256 shades of snow goose and coal bin.
Attachment:
256_coloured_tif.png
256_coloured_tif.png [ 23.01 KiB | Viewed 16579 times ]

If i execute tif2bsb now it goes on strike.

To salvage all the work that I've put in I open the last image file...in this case tonga_chart1.tif, in the Painting Program (Ray> Graphics> Painting Program) and across the top menu bar select Palette> Set Palette Size... and then change the number from 256 to 127.

Save the file and then execute the tif2bsb command again.

Sure there might be a more elegant way....but by now we know humans are not meant to type in terminals and we just want to get the dang thing done.

We can save the elegance for another occasion.


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 19 Jun 2012, 04:29
Posts: 50
Thanks Moe and exceptionally for your helpful print screens! I've done it and pick up for .kap file and, but next, met with another problem regarded to using ready .kap file in OpenCPN:

- when i try too open my .kap file it requires TrueCrypt password, but where to find the password if it's really actual? Cause previously i've opened .kap files from nooa source and it was freely opened without password request - that's why i asked.

- i put my "locked" .kap file in /kap directory, choose as active directory and made database rebuild in Charts dialog in ToolBox, but new charts were activated and appeared only after full rebooting the system - is it normal? If yes, just say.

So, any way, now it's working and above is just for the world, take it easy. I'm realy passionated of this system!

rgrds,
Andrey


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 04 Nov 2010, 20:51
Posts: 1062
When you look in the File Manager with View>Detailed List View selected you will see that some files have an Unknown description.

Notably in this image you will see those files with the .kap extension.
Attachment:
Selection_015.png
Selection_015.png [ 38.71 KiB | Viewed 16570 times ]

The other files have a description (tiff, png, whatever).

This means the file type (.kap) is not registered, or associated, with an application. So when you "click" it there is no program waiting in the wings to "open" it.

....but the computer "thinks"; "Oh, 'unknown file', it must be an encrypted file...." and calls up TrueCrypt.

In this case it is an error. Also in error, in the image you will see CHARTCAL.DIR as a Python File. It's not. On this machine, it is set up that all text files that are not specifically assigned as documents, scripts, etc. are likely Python related.

Now, with regard to having the charts visible in Opencpn...the first go-round...what you're describing is not "normal" in my experience. But then, again, it is normal. On occasion something similar has happened to me. Why? I don't know.

I like opencpn. But it is not bug-free. In the latest version they have added "Scan Charts and Update Database" option in addition to "Force Full Database Rebuild"....so something is going on that they are trying to straightened out.

But it shouldn't require a reboot....maybe a restart of opencpn. So in that case, no, it's not normal....but I'm glad you like the system; I do too.


Top
   
 
 Post subject: Re: Problem with tif2bsb usage

Joined: 19 Jun 2012, 04:29
Posts: 50
Thanks for your last. Yes, may be restart opencpn only, I do not remember exactly either I've done it that time. But "system" is alive organizm witch can amize as well as human's, may be it is exact case ))

Rgrds


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


Search for:
cron

Credits © 2010 - 2024