Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layer reports true on HasImage, panics when encoded as image #19

Open
drdreo opened this issue Nov 3, 2022 · 0 comments
Open

Layer reports true on HasImage, panics when encoded as image #19

drdreo opened this issue Nov 3, 2022 · 0 comments

Comments

@drdreo
Copy link

drdreo commented Nov 3, 2022

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant