Ticket #650 (closed feature: fixed)

Opened 6 years ago

Last modified 6 years ago

Default image foramt to not-jpg for transparent images

Reported by: crschmidt Owned by: tschaub
Priority: minor Milestone: 2.5 Release
Component: Layer.WMS Version:
Keywords: Cc:
State:

Description

transparent wms images should not be jpegs, since jpegs can't be transparent. This was originally reported by cameronshorter, who I forgot to open the ticket on behalf of.

Attachments

wms.patch Download (2.6 KB) - added by crschmidt 6 years ago.
wms2.patch Download (5.1 KB) - added by euzuro 6 years ago.
slight rearranging of the logic for this patch, since the two tests were checking for transparency, using that instead.

Change History

Changed 6 years ago by crschmidt

Changed 6 years ago by crschmidt

  • keywords review added

If a layer is marked transparent, we should try to help the user out by making it transparent for them. This patch adds logic in initialize that changes image/jpeg to either image/png, or, if in IE, image/gif.

Includes tests.

Changed 6 years ago by camerons

For completeness, this is a duplicate of  http://trac.openlayers.org/ticket/423

Changed 6 years ago by euzuro

slight rearranging of the logic for this patch, since the two tests were checking for transparency, using that instead.

Changed 6 years ago by euzuro

doh. funky keyboard hit return on accident. wms2 patch moves logic around a little but has the same effect, only one minor change: TRuE now registers as true for the automatic baselayer/overlay determination. If we'll do it for the image format might as well do it for that as well... right? so i changed one test to accomodate that.

other major change here is adding same logic to WMS/Untiled.js

for the love of sanity, we need to make a real, bonified Untiled/Grid distinction. That is on my *very* short list.

Changed 6 years ago by crschmidt

I'm okay with this, but would like buy-in from Tim because he expressed concern about too much magic. This magic is the kind that we've had users ask for, and is pretty easy to override, but at the same time, it's not something I want to go ahead with without approval from Tim.

Changed 6 years ago by euzuro

  • owner set to tschaub

Changed 6 years ago by tschaub

  • keywords commit added; review removed

I think the test messages should say

"transparent = TRuE causes non-image/jpeg format"

instead of

"transparent = TRuE causes image/gif format"

or test explicitly for non-jpeg and then make sure the alphaHack logic is followed, but that is just because it is easy to be picky when you're not the one writing tests.

Thanks for applying the magic.

Changed 6 years ago by euzuro

  • status changed from new to closed
  • resolution set to fixed

patch modified and applied. r3554

Changed 6 years ago by euzuro

  • keywords commit removed
Note: See TracTickets for help on using tickets.