imagetype

package
v3.24.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Types = map[string]Type{
		"jpeg": JPEG,
		"jpg":  JPEG,
		"png":  PNG,
		"webp": WEBP,
		"gif":  GIF,
		"ico":  ICO,
		"svg":  SVG,
		"heic": HEIC,
		"avif": AVIF,
		"bmp":  BMP,
		"tiff": TIFF,
	}
)

Functions

func ContentDisposition added in v3.8.0

func ContentDisposition(filename, ext string, returnAttachment bool) string

Types

type Type

type Type int
const (
	Unknown Type = iota
	JPEG
	PNG
	WEBP
	GIF
	ICO
	SVG
	HEIC
	AVIF
	BMP
	TIFF
)

func ByMime added in v3.8.0

func ByMime(mime string) Type

func (Type) ContentDisposition

func (it Type) ContentDisposition(filename string, returnAttachment bool) string

func (Type) ContentDispositionFromURL

func (it Type) ContentDispositionFromURL(imageURL string, returnAttachment bool) string

func (Type) Ext added in v3.8.0

func (it Type) Ext() string

func (Type) IsVector added in v3.20.0

func (it Type) IsVector() bool

func (Type) MarshalJSON

func (it Type) MarshalJSON() ([]byte, error)

func (Type) Mime

func (it Type) Mime() string

func (Type) String

func (it Type) String() string

func (Type) SupportsAlpha

func (it Type) SupportsAlpha() bool

func (Type) SupportsAnimation

func (it Type) SupportsAnimation() bool

func (Type) SupportsColourProfile

func (it Type) SupportsColourProfile() bool

func (Type) SupportsQuality added in v3.21.0

func (it Type) SupportsQuality() bool

func (Type) SupportsThumbnail added in v3.5.0

func (it Type) SupportsThumbnail() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL