Documentation
¶
Index ¶
Constants ¶
const ( MediaImage = 1 MediaVideo = 2 MediaAudio = 3 MediaDocument = 4 )
Variables ¶
var WebFiles embed.FS
WebFiles are the package's web resources (templates and static files)
Functions ¶
func FixOrientation ¶
FixOrientation applies a transform to img corresponding to the given orientation flag.
func OrientationSize ¶
OrientationSize returns the dimensions of the image after orientation is changed.
func ReadOrientation ¶
ReadOrientation tries to read the orientation EXIF flag from image data in r. If the EXIF data block is not found or the orientation flag is not found or any other error occures while reading the data, it returns the orientationUnspecified (0) value.
Types ¶
type UpAudioVisual ¶
type UpAudioVisual struct {
MaxSize int // maximum size for AV to use original without processing
SnapshotAt time.Duration // snapshot time in video (-ve for none)
VideoResolution int
// contains filtered or unexported fields
}
func (*UpAudioVisual) Save ¶
func (up *UpAudioVisual) Save(req uploader.ReqSave) (bool, error)
Save saves the audio or video file and a thumbnail. It returns false if format conversion is needed.
func (*UpAudioVisual) Thumbnail ¶
func (up *UpAudioVisual) Thumbnail(filename string) string
Thumbnail returns the prefixed name for a thumbnail.
type UpDocument ¶
type UpDocument struct {
// contains filtered or unexported fields
}
func (*UpDocument) Save ¶
func (up *UpDocument) Save(req uploader.ReqSave) (bool, error)
Save saves the document file and a thumbnail. It always returns true, because there are no conversions.
func (*UpDocument) Thumbnail ¶
func (up *UpDocument) Thumbnail(filename string) string
Thumbnail returns the prefixed name for a thumbnail.
type UpImage ¶
type UpImage struct {
ImageQuality int // JPEG quality, 1-100
MaxDecoded int // maximum decoded image size (bytes)
MaxW int
MaxH int
// contains filtered or unexported fields
}
type UpMedia ¶
type UpMedia struct {
// media processors, linked here to allow parameter changes
AV *UpAudioVisual
Document *UpDocument
Image *UpImage
// parameters for multiple media processors
ThumbW int
ThumbH int
ThumbQuality int // between 1 and 100
// contains filtered or unexported fields
}
func NewUpMedia ¶
func NewUpMedia(uploader *uploader.Uploader, audioTypes []string, documentTypes []string, videoTypes []string, videoPackage string) *UpMedia
NewUpMedia starts and returns media processors for webparts/uploader. Public parameters may be changed before the first call to uploader.Begin.