Opened 17 years ago

Last modified 13 years ago

#2115 closed defect

AGG palette formatoption requires absolute path — at Version 8

Reported by: jmckenna Owned by: sdlime
Priority: normal Milestone: 6.0 release
Component: MapServer C Library Version: 5.0
Severity: normal Keywords:
Cc: assefa, zjames, warmerdam, tbonfort, aboudreault

Description (last modified by warmerdam)

Relative paths to the AGG palette file do not work:

OUTPUTFORMAT
    NAME "agg/png24"
    MIMETYPE "image/png; mode=24bit"
    DRIVER "AGG/PNG"
    EXTENSION "png"
    IMAGEMODE "RGB"
    FORMATOPTION "PALETTE_FORCE=TRUE"
    FORMATOPTION "PALETTE=palette.txt"  
END 

causes this error: msImageCreateWithPaletteGD(): Unable to access file. Error opening palette file palette.txt

It should be relative to the location of the mapfile.

Change History (8)

comment:1 by sdlime, 17 years ago

Component: AGGMapServer C Library

I agree and would have set it up that way if it were straightforward. Problem is that the image handling is basically mapfile independent and I don't have access to the stored path from an image format object. Not sure how best to handle...

Also changing component since this isn't specific to AGG.

Steve

comment:2 by sdlime, 17 years ago

Status: newassigned

comment:3 by jmckenna, 17 years ago

Cc: yassefa@… added

comment:4 by zjames, 17 years ago

Cc: zjames added

comment:5 by hobu, 17 years ago

Milestone: 5.0 release5.2 release

Pushing this forward to 5.2, maybe we can figure out a clean way to deal with it then.

comment:6 by sdlime, 17 years ago

We'll need to stuff the map path in the image object some place OR pass mapObj's around in places we haven't in the past.

Steve

comment:7 by sdlime, 16 years ago

Cc: warmerdam added

Anybody have ideas on how to best address? I see at least three options:

1 - add a new structure member, a pointer back to the parent mapObj to outputFormatObj's 2 - add a new structure member (mappath) to outputFormatObj's to hold the value of mappath from the initializing mapObj 3 - add code to mapfile.c so that mappath is added as a format option in cases where PALETTE= is found.

1 is something we do elsewhere (e.g. layers) and would keep the outputFormatObj in sync with the mapObj and is probably the easiest to implement.

Thoughts?

Steve

comment:8 by warmerdam, 16 years ago

Description: modified (diff)

Steve,

What about changing msSaveImage() to pass the mapObj * down into msSaveImageGD() and msSaveImageGDCtx()? msSaveImageGDAL() already requires the mapObj.

I'm not keen on "back pointers" to the map in objects like the outputFormatObj because they are tricky to keep valid when things are moved around.

Note: See TracTickets for help on using tickets.