The Style editor fetches the custom legend image from the same folder of the style, if it does not find it, it searches in the main "styles" directory. The WMS will only search in the same folder of the style. So if the image is in the main "style" directory, and the style is actually inside a workspace, the preview will still show a correct preview, when the WMS will fail to fetch the legend image and fallback to the generated one. The two different behaviors should be aligned. To reproduce:
NOTE: This is testable on vector styles only until GEOS-7636 Open is merged (it prevents raster styles to show legends at all) |