These messages and/or logic are no longer accurate/optimal:
|
func (r *resourceAdapter) getImageOps() images.ImageResourceOps { |
|
img, ok := r.target.(images.ImageResourceOps) |
|
if !ok { |
|
if r.MediaType().SubType == "svg" { |
|
panic("this method is only available for raster images. To determine if an image is SVG, you can do {{ if eq .MediaType.SubType \"svg\" }}{{ end }}") |
|
} |
|
panic("this method is only available for image resources") |
|
} |
|
r.init(false, false) |
|
return img |
|
} |
For example, when using Width against an .ico file you get this:
error calling Width: this method is only available for image resources
But an .ico file is an image resource per reflect.IsImageResource.
These messages and/or logic are no longer accurate/optimal:
hugo/resources/transform.go
Lines 395 to 405 in 5594b28
For example, when using
Widthagainst an.icofile you get this:But an
.icofile is an image resource perreflect.IsImageResource.