updated jsvm types
This commit is contained in:
+3037
-3037
File diff suppressed because it is too large
Load Diff
@@ -497,7 +497,7 @@ var ThumbSizeRegex = regexp.MustCompile(`^(\d+)x(\d+)(t|b|f)?$`)
|
|||||||
// - WxHt (eg. 300x100t) - resize and crop to WxH viewbox (from top)
|
// - WxHt (eg. 300x100t) - resize and crop to WxH viewbox (from top)
|
||||||
// - WxHb (eg. 300x100b) - resize and crop to WxH viewbox (from bottom)
|
// - WxHb (eg. 300x100b) - resize and crop to WxH viewbox (from bottom)
|
||||||
// - WxHf (eg. 300x100f) - fit inside a WxH viewbox (without cropping)
|
// - WxHf (eg. 300x100f) - fit inside a WxH viewbox (without cropping)
|
||||||
func (s *System) CreateThumb(originalKey string, thumbKey, thumbSize string) error {
|
func (s *System) CreateThumb(originalKey, thumbKey, thumbSize string) error {
|
||||||
// note: the wrapping is an extra precaution since there were several
|
// note: the wrapping is an extra precaution since there were several
|
||||||
// golang.org/x/image panic related issues over the years
|
// golang.org/x/image panic related issues over the years
|
||||||
return routine.SafeWrap(func() error {
|
return routine.SafeWrap(func() error {
|
||||||
@@ -505,7 +505,7 @@ func (s *System) CreateThumb(originalKey string, thumbKey, thumbSize string) err
|
|||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *System) createThumb(originalKey string, thumbKey, thumbSize string) error {
|
func (s *System) createThumb(originalKey, thumbKey, thumbSize string) error {
|
||||||
sizeParts := ThumbSizeRegex.FindStringSubmatch(thumbSize)
|
sizeParts := ThumbSizeRegex.FindStringSubmatch(thumbSize)
|
||||||
if len(sizeParts) != 4 {
|
if len(sizeParts) != 4 {
|
||||||
return errors.New("thumb size must be in WxH, WxHt, WxHb or WxHf format")
|
return errors.New("thumb size must be in WxH, WxHt, WxHb or WxHf format")
|
||||||
|
|||||||
Reference in New Issue
Block a user