Opened 16 years ago

Closed 16 years ago

#2391 closed defect (fixed)

GD ouptout problem with rotatated pixmap symbols

Reported by: assefa Owned by: sdlime
Priority: normal Milestone: 5.0.3 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc:

Description

There seems to be a problem using a pixmap symbol (either on a point layer or on a line layer) with how the background color is rendered :

  • if the size used in the style is the same size as the pixmap symbol and there is no angle (basically no stretching), rendering seems correct and background is transparent
  • if the symbol is rotated or stretched, the background is not transparent
  • when a pixmap symbol is used on a line layer, the background is not transparent

I am not sure that I explain properly this but I have attached a couple of images to show what I mean:

  • image 1 : point_lyr_no_rotation.png (symbol size is 20, style size is 20)
  • image 2 : point_lyr_with_rotation.png (symbol size is 20, style size is 20 with 45deg angle)
  • image 3 : point_lyr_with_stretched.png (symbol size is 20, style size is 40 no rotation)
  • image 4 : line_layer.png (symbol size is 20, style size is 20)
  • image 5: : line_layer_stretched.png (symbol size is 20, style size is 40)

I can provide map/layers/symbol file if necessary

Attachments (2)

bug2391.zip (136.0 KB ) - added by assefa 16 years ago.
zip file
bug2391_2.zip (122.9 KB ) - added by assefa 16 years ago.
zip file

Download all attachments as: .zip

Change History (13)

by assefa, 16 years ago

Attachment: bug2391.zip added

zip file

comment:1 by sdlime, 16 years ago

Milestone: 5.0.1 release
Status: newassigned

Dammit, I thought I had this one fixed. Argh...

Steve

comment:2 by sdlime, 16 years ago

So this is 8-bit marker with 8-bit PNG output, correct? I assume you're not doing 24-bit to 8-bit processing.

Steve

comment:3 by sdlime, 16 years ago

Ok, I did some testing. I didn't see problems unless I changed the background color for the images to something other than white. Here's what I see:

8-bit png (IMAGETYPE PNG):

  • no rotation, no scale: ok
  • no rotation, scale: ok
  • rotation, no scale: ok
  • rotation, scale: ok

24-bit png (IMAGETYPE PNG24):

  • no rotation, no scale: ok
  • no rotation, scale: FAILS
  • rotation, no scale: ok
  • rotation, scale: FAILS

This is only with a point layer like so:

MAP

NAME '2391' EXTENT 0 0 200 200 SIZE 200 200 UNITS METERS

IMAGECOLOR 231 231 231

IMAGETYPE PNG

LAYER

NAME 'test' TYPE POINT STATUS ON FEATURE

POINTS 30 30 70 80 END

END CLASS

STYLE

SYMBOL 'red-square.gif' SIZE 40 ANGLE -30

END

END

END

END

Is this what you're seeing? If so, it may be the 24-bit scaling that's busted.

Steve

by assefa, 16 years ago

Attachment: bug2391_2.zip added

zip file

comment:4 by assefa, 16 years ago

Yes : I am using an 8-bit marker with 8-bit GD PNG output.

The initial images I sent were using a gif marker with a transparent background, not sure if that makes a difference.

I converted the gif marker to a png marker and I have the same results (the case if no scaling with a rotation of -45 on a point layer). I have attached what I get using the gd rendered vs the agg rendered for the same layer/marker (Plus I added the red-square.png used in this example). So I still see a problem for point layers. Not sure why we do not get the same result though. (I am using MapServer from svn, gd-2.0.33)

comment:5 by sdlime, 16 years ago

I'm using gd-2.0.35. Might be worth upgrading as there were a huge number of fixes made.

Steve

comment:6 by assefa, 16 years ago

  • Effectively upgrading to 2.0.35 solved my issues with point layers using an 8bit gif or png image as a symbol (with a transparent background) : I have tried witn:
    • no scaling : works
    • scaling : works
    • rotation : works

Thanks for this.

But : I sill have a problem with line layers using the same symbol (draw along a line); The background is not transparent. This is the case every time there is a rotation or if the symbol is stretched. My settings of the layer/symbol are: LAYER

NAME "rail_test" TYPE LINE STATUS ON DATA rail CLASS

STYLE

SYMBOL 'red_square' SIZE 20

..

Symbol Name 'red_square' Type PIXMAP #TRANSPARENT 0 GAP -20 IMAGE "./markers/red-square.gif" END

comment:7 by sdlime, 16 years ago

Let's leave this bug open and I'll take a look this weekend.

Steve

comment:8 by sdlime, 16 years ago

Assefa: Could you try GD 2.0.36? There were some explicit fixes with rotated images and transparency.

Steve

comment:9 by sdlime, 16 years ago

Milestone: 5.0.1 release5.0.2 release

I don't think there's anything left to fix, but I'll leave this in the hopper for 5.0.2 just in case.

Steve

comment:10 by sdlime, 16 years ago

I'm going to close this. Can file something new if the issue persists with new versions of GD...

Steve

comment:11 by sdlime, 16 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.