lua.wetgenes.grd.save
g:save(opts)
Save an image to memory or filesytem depending on settings in opts.
opts.fmt
Lets you choose an image format, the strings "jpg","png" or "gif" will be converted to the appropriate wgrd.FMT_HINT_* value.
We will guess opts.fmt from the file name extension if it is not provided and a file name is.
opts.filename
Flags this as a load the file system and provides the file name to write to. If no filename is given then we will be saving into memory and be returning that data string as the first return value.
Returns nil,error if something goes wrong so can be used with assert.
If no file name is given then we return the data string that we saved.