self::$type_map, 'w' => self::$watermark, ) ); conf_update_param('derivatives', addslashes($ser) ); file_put_contents(PHPWG_ROOT_PATH.$conf['data_location'].'derivatives.dat', $ser); self::build_maps(); } private static function make_default() { self::$watermark = new WatermarkParams(); self::$type_map[IMG_SQUARE] = new DerivativeParams( SizingParams::square(100,100) ); self::$type_map[IMG_THUMB] = new DerivativeParams( SizingParams::classic(144,144) ); self::$type_map[IMG_SMALL] = new DerivativeParams( SizingParams::classic(240,240) ); self::$type_map[IMG_MEDIUM] = new DerivativeParams( SizingParams::classic(432,432) ); self::$type_map[IMG_LARGE] = new DerivativeParams( SizingParams::classic(648,576) ); self::$type_map[IMG_XLARGE] = new DerivativeParams( SizingParams::classic(864,648) ); self::$type_map[IMG_XXLARGE] = new DerivativeParams( SizingParams::classic(1200,900) ); } public static function apply_global($params) { if (!empty(self::$watermark->file) && (self::$watermark->min_size[0]<=$params->sizing->ideal_size[0] && self::$watermark->min_size[1]<=$params->sizing->ideal_size[1] ) ) { $params->use_watermark = true; } } private static function build_maps() { foreach (self::$type_map as $type=>$params) { $params->type = $type; self::apply_global($params); } self::$all_type_map = self::$type_map; for ($i=0; $i=0; $j--) { $target = self::$all_types[$j]; if (isset(self::$type_map[$target])) { self::$all_type_map[$tocheck] = self::$type_map[$target]; self::$undefined_type_map[$tocheck] = $target; break; } } } } } } ?>