
Hi I'm having problems with the TYP file appearing corrupt. A simple file was working as expected, but adding a bit more caused very strange display properties in unrelated items on the Garmin device - eg, an area showed as a pattern never seen before, and, when selected, claimed to be waypoint. Running test.display on the file, sometimes I get: Exception in thread "main" java.lang.AssertionError at test.display.TypSectionDisplayer.printLabels(TypSectionDisplayer.java:1 19) at test.display.PolygonDisplayer.printStyles(PolygonDisplayer.java:83) at test.display.PolygonDisplayer.printPolygonDefs(PolygonDisplayer.java:60 ) at test.display.PolygonDisplayer.print(PolygonDisplayer.java:42) at test.display.TypDisplay.print(TypDisplay.java:56) at test.display.CommonDisplay.display(CommonDisplay.java:171) at test.display.CommonDisplay.display(CommonDisplay.java:196) at test.display.TypDisplay.main(TypDisplay.java:302) and, making slight adjustments to the length of some strings, it doesn't crash but the test output has lots of non-printing characters in the label display and sometimes messages about overshoot {-ve val} Gradually deleting almost all the contents of the typ file, it now always crashes display. Changing the xpm from a bit-map to a block colour makes it OK. This is file badTypMin.txt Going back to a version with more contents, changing the string in polygon type 0x58 changes the crash/corruption behaviour as per the comment. This is file badTypMore.txt Also attached is tst.sh that I've been using to compile and display the badTyp.txt file Ticker

Hi I've just found the note that says non-line pixmaps must be 32x32 so that is probably my problem. Testing it now. Ticker On Fri, 2018-11-09 at 13:06 +0000, Ticker Berkin wrote:
Hi
I'm having problems with the TYP file appearing corrupt. A simple file was working as expected, but adding a bit more caused very strange display properties in unrelated items on the Garmin device - eg, an area showed as a pattern never seen before, and, when selected, claimed to be waypoint.
Running test.display on the file, sometimes I get: Exception in thread "main" java.lang.AssertionError at test.display.TypSectionDisplayer.printLabels(TypSectionDisplayer.java :1 19) at test.display.PolygonDisplayer.printStyles(PolygonDisplayer.java:83) at test.display.PolygonDisplayer.printPolygonDefs(PolygonDisplayer.java: 60 ) at test.display.PolygonDisplayer.print(PolygonDisplayer.java:42) at test.display.TypDisplay.print(TypDisplay.java:56) at test.display.CommonDisplay.display(CommonDisplay.java:171) at test.display.CommonDisplay.display(CommonDisplay.java:196) at test.display.TypDisplay.main(TypDisplay.java:302)
and, making slight adjustments to the length of some strings, it doesn't crash but the test output has lots of non-printing characters in the label display and sometimes messages about overshoot {-ve val}
Gradually deleting almost all the contents of the typ file, it now always crashes display. Changing the xpm from a bit-map to a block colour makes it OK. This is file badTypMin.txt
Going back to a version with more contents, changing the string in polygon type 0x58 changes the crash/corruption behaviour as per the comment. This is file badTypMore.txt
Also attached is tst.sh that I've been using to compile and display the badTyp.txt file
Ticker _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker That is correct: 32x32 Even though the typ files includes the xpm with each bitgmap polygon, I have a suspicion that the firmware ignores these settings and sets the dimensions to 32x32 by default This certainly explains the gobbledygook you got. I have yet to see a typ file which allows 16x16 for polygons I have no idea if the TYP compiler sets the dimensions to 32x32 by default. r Nick On 09/11/2018 14:52, Ticker Berkin wrote:
Hi
I've just found the note that says non-line pixmaps must be 32x32 so that is probably my problem.
Testing it now.
Ticker
On Fri, 2018-11-09 at 13:06 +0000, Ticker Berkin wrote:
Hi
I'm having problems with the TYP file appearing corrupt. A simple file was working as expected, but adding a bit more caused very strange display properties in unrelated items on the Garmin device - eg, an area showed as a pattern never seen before, and, when selected, claimed to be waypoint.
Running test.display on the file, sometimes I get: Exception in thread "main" java.lang.AssertionError at test.display.TypSectionDisplayer.printLabels(TypSectionDisplayer.java :1 19) at test.display.PolygonDisplayer.printStyles(PolygonDisplayer.java:83) at test.display.PolygonDisplayer.printPolygonDefs(PolygonDisplayer.java: 60 ) at test.display.PolygonDisplayer.print(PolygonDisplayer.java:42) at test.display.TypDisplay.print(TypDisplay.java:56) at test.display.CommonDisplay.display(CommonDisplay.java:171) at test.display.CommonDisplay.display(CommonDisplay.java:196) at test.display.TypDisplay.main(TypDisplay.java:302)
and, making slight adjustments to the length of some strings, it doesn't crash but the test output has lots of non-printing characters in the label display and sometimes messages about overshoot {-ve val}
Gradually deleting almost all the contents of the typ file, it now always crashes display. Changing the xpm from a bit-map to a block colour makes it OK. This is file badTypMin.txt
Going back to a version with more contents, changing the string in polygon type 0x58 changes the crash/corruption behaviour as per the comment. This is file badTypMore.txt
Also attached is tst.sh that I've been using to compile and display the badTyp.txt file
Ticker _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker
I'm having problems with the TYP file appearing corrupt. A simple file was working as expected, but adding a bit more caused very strange display properties in unrelated items on the Garmin device - eg, an area showed as a pattern never seen before, and, when selected, claimed to be waypoint.
The troublesome polygon is this one:
[_polygon] Type=0x58 ; crashes with: String=County ; corruption with: String=Countyxxxxx Xpm="16 16 2 1" ". c none" "1 c #FFFFFF" "................" "................" [ ... ]
It has a size of 16x16, but polygon bitmaps must be 32x32. Although documented (at http://www.mkgmap.org.uk/doc/typ-compiler), this restriction is not checked by the code, sorry about that. I've attached a patch to check this. There are other possible checks so this may be expanded before committing. Steve

Thanks Steve I've applied the patch to my system and it behaves as expected. Ticker On Fri, 2018-11-09 at 15:34 +0000, Steve Ratcliffe wrote:
Hi Ticker
I'm having problems with the TYP file appearing corrupt. A simple file was working as expected, but adding a bit more caused very strange display properties in unrelated items on the Garmin device - eg, an area showed as a pattern never seen before, and, when selected, claimed to be waypoint.
The troublesome polygon is this one:
[_polygon] Type=0x58 ; crashes with: String=County ; corruption with: String=Countyxxxxx Xpm="16 16 2 1" ". c none" "1 c #FFFFFF" "................" "................" [ ... ]
It has a size of 16x16, but polygon bitmaps must be 32x32.
Although documented (at http://www.mkgmap.org.uk/doc/typ-compiler), this restriction is not checked by the code, sorry about that.
I've attached a patch to check this. There are other possible checks so this may be expanded before committing.
Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (4)
-
osm@pinns
-
Steve Ratcliffe
-
Ticker Berkin
-
Ticker Berkin