Behavior
When a certain layer is a vector (simple pen tool shape), HasImage() returns true but the Picker of said layer has no image data which panics on png.Encode with the message:
png: invalid format: invalid image size: 0x0
Expected
A layer which currently can not be parsed, and hence, has no image data, should return false on HasImage.
Code
if !l.HasImage() {
return nil
}
fmt.Printf("%s -> %s.png\n", layerName, filename)
out, err := os.Create(fmt.Sprintf("%s.png", filename))
if err != nil {
return err
}
defer out.Close()
return png.Encode(out, l.Picker)
Behavior
When a certain layer is a vector (simple pen tool shape),
HasImage()returns true but the Picker of said layer has no image data which panics onpng.Encodewith the message:png: invalid format: invalid image size: 0x0Expected
A layer which currently can not be parsed, and hence, has no image data, should return false on
HasImage.Code