When assigning image/jpeg to the "file format:" pull-down for a wms layer and then displaying the layer the sites/all/modules/openlayers/OpenLayers-2.9.1/OpenLayers.js file changes the format from image/jpeg to image/png. I have temporarily fixed this by finding the 2 places where /OpenLayers.js changes image/jpeg to image/png by preventing this from happening. Somehow what is passed to /OpenLayers.js as far as the format is interpreted as needing to change from image/jpeg to image/png. When I use openlayers outside of Drupal and the openlayers module and pass a format of image/jpeg to openlayers it does not change it to image/png.
Below is the area that I had to modify within /OpenLayers.js:
if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png";
Comments
Comment #1
tmcw CreditAttribution: tmcw commentedIs your WMS layer set as transparent? If it is, then OpenLayers will change the format to png, because jpegs can't be transparent. The relevant chunk of code is around the part you changed:
Comment #2
mitchelljj CreditAttribution: mitchelljj commentedNo I have not set the image/jpeg layer to transparent. Which leads me to think based on the previous comment that even though I did not check the transparent checkbox that the openlayers module is passing transparent as true to OpenLayers.js.
Comment #3
tmcw CreditAttribution: tmcw commentedYou're right, it's just hardcoded in there. I'll pull it out in a second.
Comment #4
tmcw CreditAttribution: tmcw commentedFixed in: http://drupal.org/cvs?commit=371932