Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to load PNG32 on arcgis ImageServer that doesnt support it #8608

Closed
elunty opened this issue Sep 7, 2018 · 5 comments
Closed

Trying to load PNG32 on arcgis ImageServer that doesnt support it #8608

elunty opened this issue Sep 7, 2018 · 5 comments
Labels

Comments

@elunty
Copy link

elunty commented Sep 7, 2018

Some ImageServer urls dont have png32 support, but we still try to load them when using an ImageServer url and ImageArcGISRest

Example (valid server):
https://jsfiddle.net/kpetw84h/1/

Example (server with only png/png8/png24 support)
https://jsfiddle.net/72ux4c1w/

Edit: I've just noticed that you can update this with params, but maybe we should use lowercase 'png' as the default, rather than PNG32 ?

@ahocevar
Copy link
Member

ahocevar commented Sep 8, 2018

According to the WMS spec, OpenLayers uses a MIME type (default: image/png) as value of the FORMAT param. If you want to use a different format, configure your WMS source with e.g.

params: {
  FORMAT: 'image/png8'
}

@elunty
Copy link
Author

elunty commented Sep 8, 2018

https://openlayers.org/en/latest/apidoc/module-ol_source_TileArcGISRest.html uses PNG32 as default, I'm just suggesting changing to png (or png8 like you say) as the default, in an attempt for better compatability with arcgis ImageServers

@ahocevar
Copy link
Member

ahocevar commented Sep 8, 2018

Ah sorry, for some reason I thought you were takling about ol/source/ImageWMS, despite seeing ol/source/ImageArcGISRest in your fiddle.

The reason why png32 is the default is because in many scenarios, layers from these servers are used as overlays, so transparency is important, which you don't get from png24. And with png8, palettes are applied, which can result in changing colors when a new image is loaded after panning.

If you can think of documentation improvements that make it easier for users to find out why they don't get the expected result with servers that do not support png32, we'd appreciate a pull request.

@elunty
Copy link
Author

elunty commented Sep 8, 2018

Ah.. interesting. I just stumbled into some map server stuff for work, so maybe "normal" users of this stuff would know better. Its a shame ?f=pjson doesn't return supported types. My only thought would be to add some small warning such as "be aware that not all servers support png32" or something in the docs for params.

Edit: Ah, looks like MapServers return supportedImageFormatTypes with ?f=pjson, but ImageServers dont. How annoying.

@stale
Copy link

stale bot commented May 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 22, 2019
@stale stale bot closed this as completed May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants