Opened 21 years ago
Closed 21 years ago
#240 closed defect (fixed)
ms_newMapObj('') does not create the default outputformats
Reported by: | Owned by: | jlacroix | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapScript-PHP | Version: | 4.0 |
Severity: | normal | Keywords: | |
Cc: |
Description
ms_newMapObj('') does not create the default outputformats, however ms_newMapObj('test.map') does, even if test.map has only one line ('END').
Change History (7)
comment:2 by , 21 years ago
Status: | new → assigned |
---|
comment:3 by , 21 years ago
Cc: | added |
---|
I would like to always create the default output formats even if the mapfile contains at least one output format. Any format with the same name defined in the mapfile would take precedence of course. (Right now if the mapfile contains one output format defn then none of the default output formats are created.) This would allow us to more easily fix this bug with the creation of an empty mapObj in memory, and would prevent the annoying side effect that happens if you create a custom output format for SWF for instance, and then you lose all the default output formats for GD image types that used to be available by default. Any objections with this change?
comment:5 by , 21 years ago
All default output format are now created with mapscript even if output format are specified. For this I created a new function in mapfile.c (called by mapscript), msNewMapObj() that call initMap and msPostMapParseOutputFormatSetup(). Mapscript call this function if there's no mapfile specified with ms_newMapObj(). I also create a new driver for the 24bit png. GD/PNG24. I don't close the bug as docuentation for this new driver is not update.
comment:6 by , 21 years ago
Julien / Daniel, I have redone some of the work in mapoutput.c. Some issues where: o Daniel's addition of PNG24 support would produce an extra, potentially unreferenced, PNG24 outputFormatObj if msCreateDefaultOutputFormat() was called from elsewhere with "GD/PNG" as the driver (which it is). o Julien's logic put all the testing for existing drivers in msCreateDefaultOutputFormat(), instead of msApplyDefaultOutputFormats() which would break stuff that tries to create alternate outputFormatObj's for the given drivers. o The changes resulted in outputFormatObjs with odd driver names like "GD/PNG24" which is not legitimate. Instead there should be two outputFormatObj's with the driver "GD/PNG", one named "png" with 8bit characteristics, and one named "png24" with 24bit characteristics. The key to remember is that msCreateDefaultOutputFormat() is not just for creating the default list attached to a map. It is also used anytime someone creates an outputFormatObj. The idea is they create a default one, and then modify the parameters of interest. I have modified some of the autotests to verify that: o The "PNG24" format is being created, and operates in 24bit mode. o The default formats are created even if the user defines custom formats. o The users custom format definitions will be used in preference to any default format definitions. I encourage you to review the current mapoutput.c code and ensure it does what you need. Thanks for ensuring he ms_newMapObj() aspect works properly now.
comment:7 by , 21 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Sorry about the mess, and thanks for fixing it. I made a few tests and the formats are still created by default, including the PNG24 format when GD2 is available. Marking bug as fixed.
Note:
See TracTickets
for help on using tickets.