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

Made image loading failure in preload() not to stop whole process #5918

Merged
merged 2 commits into from
Jan 8, 2023

Conversation

r21nomi
Copy link
Contributor

@r21nomi r21nomi commented Dec 25, 2022

Resolves #5032

Issue

  • setup(), draw() was not called if an image loading in preload() failed
    • It's inconvenient for the case like the image was on server and network connection issue

Changes

  • Made image loading failure in preload() not to stop whole process
    • setup(), draw() will be called if there was an failure callback in p5.loadImage()
    • setup(), draw() will not be called if there was no failure callback in p5.loadImage()

I know @limzykenneth says this might be breaking changes.
So please check this changes are right way or not.

PR Checklist

@welcome
Copy link

welcome bot commented Dec 25, 2022

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

@limzykenneth
Copy link
Member

I think this is fine to fix now that I had a look at it. There is no easy semantic way to continue the sketch after a handled error halted the sketch and a error halted sketch will probably not be counted as a semantic sketch so changing its behaviour won't be a breaking change.

#5292 Can be fix in the same manner as well (along with other load functions with the same behaviour)

@limzykenneth limzykenneth merged commit 7071247 into processing:main Jan 8, 2023
@r21nomi r21nomi deleted the issue/load-image branch January 10, 2023 12:40
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

Successfully merging this pull request may close these issues.

loadImage can brake the whole sketch
3 participants