Opened 20 years ago

Closed 16 years ago

#979 closed defect (fixed)

[PHP MapScript] Sync outputFormatObj with SWIG MapScript

Reported by: dmorissette Owned by: mapserverbugs
Priority: high Milestone: 5.2 release
Component: MapScript-PHP Version: 4.3
Severity: normal Keywords:
Cc: mapserver@…

Description (last modified by dmorissette)

The current implementation of outputFormatObj in PHP MapScript is read-only and
doesn't allow editing any of its attributes, making it impossible to set the
output image transparent for instance (see bug 977).

We need to sync the outputFormatObj in PHP MapScript with the one in SWIG (see
mapscript/doc/mapscript.txt), including the ability to create new
outputFormatObj and to assign them where appropriate.

Change History (8)

comment:1 by dmorissette, 20 years ago

Milestone: 4.4 release
I think this is important for 4.4

comment:2 by dmorissette, 20 years ago

blocked: 977

comment:3 by dmorissette, 20 years ago

Status: newassigned
Methods to be implemented in mapObj:

  int map.appendOutputFormat( outputFormatObj format )
  int map.removeOutputFormat( string name )
  outputFormatObj map.getOutputFormat( string imagetype ) 

Make the following attributes editable:
   string    name;
   string    mimetype;
   string    driver;
   string    extension;
   int       renderer;
   int       imagemode     // MS_IMAGEMODE_* value.
   int       transparent

And then add the following outputFormatObj methods (from mapscript.txt):

new outputFormatObj( string driver [, string name=driver ] ) : outputFormatObj_
    Create new instance.  If *name* is not provided, the value of *driver*
    is used as a name.
    
getOption( string key [, string value="" ] ) : string
    Return the option at *key* or *value* if *key* is not a valid
    hash index.

setOption( string key, string value ) : void
    Set the option at *key* to *value*.

validate() : int
    Checks some internal consistency issues, and returns MS_TRUE if things
    are OK and MS_FALSE if there are problems.  Some problems are fixed up
    internally.  May produce debug output if issues encountered.  
    

comment:4 by dmorissette, 20 years ago

Working on this.

comment:5 by dmorissette, 20 years ago

I have made the outputformat members editable and added the validate() method.
This will make it in 4.4.0-beta1. I also updated the PHP MapScript README to
document the fact that the mapObj parameters are deprecated.

Still need to add the ability to create new outputFOrmatObj and assign them to a
map. This will be done after 4.4.0-beta1

comment:6 by mapserver@…, 19 years ago

Cc: mapserver@… added

comment:7 by dmorissette, 17 years ago

Description: modified (diff)
Milestone: 5.0 release5.2 release

comment:8 by dmorissette, 16 years ago

Resolution: fixed
Status: assignedclosed

Closing fixed. The members were made editable in v4.4.

With respect to the ability to create new outputFOrmatObj and assign them to a map, if we could live without that so long then it's probably not that important... let's create a new ticket if/when that's really needed.

Note: See TracTickets for help on using tickets.