func (f VideoFilter) ScaleMax(inputWidth, inputHeight, maxSize int) VideoFilter {
	// get the smaller dimension of the input
	videoSize := inputHeight
	if inputWidth < videoSize {
		videoSize = inputWidth
	}

	// if maxSize is larger than the video dimension, then no-op
	if maxSize >= videoSize || maxSize == 0 {
		return f
	}

	// we're setting either the width or height
	// we'll set the smaller dimesion
	if inputWidth > inputHeight {
		// set the height
		return f.ScaleDimensions(-2, maxSize)
	}

	return f.ScaleDimensions(maxSize, -2)
}
// ScaleMax returns a VideoFilter scaling to maxSize. It will scale width if it is larger than height, otherwise it will scale height.
ScaleMax returns a VideoFilter scaling to maxSize. It will scale width if it is larger than height, otherwise it will scale height.
// ScaleMax returns a VideoFilter scaling to maxSize . It will scale width if it is larger than height otherwise it will scale height .
func (f VideoFilter) ScaleMax(inputWidth, inputHeight, maxSize int) VideoFilter {
	videoSize := inputHeight
	if inputWidth < videoSize {
		videoSize = inputWidth
	}
	if maxSize >= videoSize || maxSize == 0 {
		return f
	}
	if inputWidth > inputHeight {
		return f.ScaleDimensions(-2, maxSize)
	}
	return f.ScaleDimensions(maxSize, -2)
}
func ( f VideoFilter ) ScaleMax ( inputWidth , inputHeight , maxSize int ) VideoFilter { videoSize := inputHeight if inputWidth < videoSize { videoSize = inputWidth } if maxSize >= videoSize || maxSize == 0 { return f } if inputWidth > inputHeight { return f . ScaleDimensions ( - 2 , maxSize ) } return f . ScaleDimensions ( maxSize , - 2 ) }
ScaleMax returns a VideoFilter scaling to maxSize.
ScaleMax returns a VideoFilter scaling to maxSize .
// get the smaller dimension of the input // if maxSize is larger than the video dimension, then no-op // we're setting either the width or height // we'll set the smaller dimesion // set the height