/*
 *
 * Class methods
 * #############################################################################
 * chkQuality() - Validate image quality values
 * chkType() - Validate image type to supported values
 * getImageInfo() - Get image width, height, type, color dept (bits) and mime type
 * getImageSize() - If reference size supplied, calculate the needed width 
 *                  and height to keep image proportional. Else, return actual 
 *                  image width and height.
 * getImageType() - Get image type (jpg, png, webp, gif or bmp)
 * getTypeName() - Convert from php numeric type of image to image type name
 * imagecopymergealpha() - Path to fix troubles with alpha channels with imagecopymerge
 * imagecreatefrombmp() - Return an image resource from BMP (not existing in PHP)
 * init() - Array values to initialize resize, watermark, show and save functions
 * initBackup() - Copy all init vars to backup to use vars to new operations
 * initRestore() - Restore all init vars from backup to continue operatios
 * load() - Load image file to resize and save or show
 * out() - Out loaded image resource
 * resample() - Resize and resample image to a given width and height
 *             If there is not any valid value return as jpg
 * resize() - Resize image to width, heigh, both or scale to a percentage
 * save() - Save loaded image to a given file
 * scaleStamp() - Scale watermark stamp image
 * show() - Show loaded image to screen
 * watermark() - Add a centered watermark to image from png stamp
 * 
 */


img::init()
/**
 * Init vars from conf array
 * image = Main image resource to work with
 * stamp = Stamp PNG image resource to generate watermarks
 * imagefile = Image file to generate (overwrite), the image resource
 * stampfile = Stamp PNG file to generate (overwrite), the stamp resource
 * filename = Output file name to save images
 * width = The width value to reescale images
 * height = The height value to reescale images
 * scale = The percent value to reescale images
 * pct = The transparency percent of stam to watermark images
 * stampps = Stamp percent size
 * stampos = Stamp position (ul, ur, center, ll, lr)
 * type = The php IMAGETYPE constant value of every type of image
 * quality = Quality compression of jpeg, webp and png images
 * debug = Set true to show debugging info
 * 
 * @param array $conf conf values to use with show, save, resize & watermark
 */

Use:
$cnf['conf_param'] = 'conf_value';
$wv->img->init($cnf);

Examples:
//Resize image and save it

//Config
$conf['quality'] = 85; //Compression quality
$conf['pct'] = 60; //Transparency
$conf['imagefile'] = "/path/to/origin/image.jpg"; //origin image
$conf['width'] = 480; //Resize to 480px width
$conf['type'] = IMAGETYPE_JPEG; //Save as jpeg
$conf['filename'] = "/path/to/file/image.jpg"; //Target file name

//Execute
$wv->img->init($conf);
$wv->img->resize();
$wv->img->save();



//Add watermark

//Config
$conf['quality'] = 80; //Compression quality
$conf['stampps'] = 20; //Stamp percent size
$conf['stampos'] = 'center'; //stamp position (ul, ur, center, ll, lr)
$conf['pct'] = 40; //Transparency
$conf['stampfile'] = "/path/to/watermark.png"; //stamp image
$conf['imagefile'] = "/path/to/origin/image.jpg"; //origin image
$conf['width'] = 1024; //Resize to 1024px width
$conf['type'] = IMAGETYPE_JPEG; //Save as jpeg
$conf['filename'] = "/path/to/file/image.jpg"; //Target file name

//Execute
$wv->img->init($conf);
$wv->img->resize();
$wv->img->save();