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 )
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 , 17 years ago
Component: | AGG → MapServer C Library |
---|
comment:2 by , 17 years ago
Status: | new → assigned |
---|
comment:3 by , 17 years ago
Cc: | added |
---|
comment:4 by , 17 years ago
Cc: | added |
---|
comment:5 by , 17 years ago
Milestone: | 5.0 release → 5.2 release |
---|
Pushing this forward to 5.2, maybe we can figure out a clean way to deal with it then.
comment:6 by , 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 , 16 years ago
Cc: | 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 , 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.
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