MapServer / MapServer-documentation

Source repository for the MapServer documentation, for the live website. Please submit pull requests to the 'main' branch.
https://mapserver.org
Other
34 stars 68 forks source link

Undocumented Mapfile COLOR options #339

Open LarsSchy opened 4 years ago

LarsSchy commented 4 years ago

It is possible to user negative color values in Mapserver. This is not documented. The most common way is to use -1 as the red value which makes a layer transparent. However some other effects can also be achieved. I documented some of those in my Mapserver Easter Egg findings: https://lists.osgeo.org/pipermail/mapserver-users/2018-March/080547.html Those are also documented in the GIST: https://gist.github.com/LarsSchy/df91553f1fda02196ba7881a129b4c64 This issue was rasied lately by a question on the dev-list by Seth: https://lists.osgeo.org/pipermail/mapserver-dev/2020-July/016246.html

tbonfort commented 4 years ago

Lars, This is clearly in "undefined behaviour" land and whereas using -1 for color was used by the GD render until mapserver 5 this isn't the case anymore. I suspect the funny colours you're getting using negative values is the effect of unsigned char wrapping and not something that has anything intentional to it. This should clearly not be documented anywhere as there is no reason this behaviour would remain in a subsequent (even minor) release. Regards, Thomas

Le jeu. 23 juil. 2020 à 18:56, Lars Schylberg notifications@github.com a écrit :

It is possible to user negative color values in Mapserver. This is not documented. The most common way is to use -1 as the red value which makes a layer transparent. However some other effects can also be achieved. I documented some of those in my Mapserver Easter Egg findings: https://lists.osgeo.org/pipermail/mapserver-users/2018-March/080547.html Those are also documented in the GIST: https://gist.github.com/LarsSchy/df91553f1fda02196ba7881a129b4c64 This issue was rasied lately by a question on the dev-list by Seth: https://lists.osgeo.org/pipermail/mapserver-dev/2020-July/016246.html

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mapserver/docs/issues/339, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACXQRPQT55EWTTICL5XG6DR5BTTPANCNFSM4PF5L6TA .

LarsSchy commented 4 years ago

Thomas, I tend to agree with You, that this should not be documented. Well since Jeff asked me, I filed the ticket. But I think this could really confuse people, so this possibility should really be removed. That is was why I wrote about this as a novel Easter Egg hidden feature and didn't sugest to document it in the first place two years ago. Regards /Lars

geographika commented 4 years ago

@LarsSchy @tbonfort - thanks for the feedback. I was trying to get a list of valid options for all Mapfile properties, and while testing validation came across -255 -255 -255 and -1 -1 -1 in Mapfiles in msautotest (see https://lists.osgeo.org/pipermail/mapserver-dev/2020-July/016246.html).

It seems to make sense to not document these and assume any negative values are invalid colours. @tbonfort - any opinion on removing the values from msautotest Mapfiles?

jmckenna commented 4 years ago

Thanks Thomas for clarifying. I'm +1 for removing these from msautotest.

sdlime commented 4 years ago

Is there code to be removed as well?

From: Jeff McKenna [mailto:notifications@github.com] Sent: Thursday, July 23, 2020 2:08 PM To: mapserver/docs docs@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [mapserver/docs] Undocumented Mapfile COLOR options (#339)

This message may be from an external email source. Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center.


Thanks Thomas for clarifying. I'm +1 to removing these from msautotest.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmapserver%2Fdocs%2Fissues%2F339%23issuecomment-663181404&data=02%7C01%7Csteve.lime%40state.mn.us%7C18a9b552b0b84696b9e908d82f3baae8%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637311280607809701&sdata=mReKxVJeUrXEOJCKlDyyxQM16t7HN7qN5dwAVCKxg%2BM%3D&reserved=0, or unsubscribehttps://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAMGN63QJBRT4LGX7BLU7JDR5CC7VANCNFSM4PF5L6TA&data=02%7C01%7Csteve.lime%40state.mn.us%7C18a9b552b0b84696b9e908d82f3baae8%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637311280607819661&sdata=caFfNBIXnAbG0Xg8WelIqS9Mm7gssX%2FSzgmcNxjQhyA%3D&reserved=0.