func NewFastImage(cfg *Config) *FastImage {
	combinedHeaders := http.Header{}
	if cfg != nil && cfg.Header != nil {
		combinedHeaders = cfg.Header
	}
	if _, exists := combinedHeaders["User-Agent"]; !exists {
		combinedHeaders.Set("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36")
	}
	dialTimeout, readTimeout := DefaultDialTimeout, DefaultReadTimeout
	if cfg != nil {
		if cfg.DialTimeout != 0 {
			dialTimeout = cfg.DialTimeout
		}
		if cfg.ReadTimeout != 0 {
			readTimeout = cfg.ReadTimeout
		}
	}
	return &FastImage{
		config: cfg,
		client: &http.Client{
			Transport: &http.Transport{
				Dial:            (&net.Dialer{Timeout: dialTimeout}).Dial,
				TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
			},
			Timeout: readTimeout,
		},
		header: combinedHeaders,
	}
}
NewFastImage returns a FastImage client
package fastimage
import (
	"bytes"
	"crypto/tls"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/url"
	"strings"
	"time"
)
type Config struct {
	Header      http.Header
	DialTimeout time.Duration
	ReadTimeout time.Duration
}
type FastImage struct {
	config *Config
	client *http.Client
	header http.Header
}
const (
	DefaultDialTimeout time.Duration = time.Second
	DefaultReadTimeout               = time.Second
)