protected function resizeImage($file, $setting)
    {
        $image = ImageManagerStatic::make($file);

        if( $setting->fit === "1" ) {
            $image->fit($setting->width, $setting->height, function ($constraint) use ($setting) {
                $constraint->upsize();
            });
        } else {
            $image->resize($setting->width, $setting->height, function ($constraint) use ($setting) {
                $constraint->aspectRatio();
                $constraint->upsize();
            });
        }

        return $image;
    }