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

Update saveFrames documentation #5694

Merged
merged 5 commits into from
Jul 3, 2022

Conversation

jesi-rgb
Copy link
Member

@jesi-rgb jesi-rgb commented Jun 19, 2022

Issue

Resolves #5685, in which some discussion was made regarding the behaviour of the saveFrames function. @endurance21 and I were inspecting the code and thought it was not working properly, but @limzykenneth went ahead and clarified why the arguments are set up like that, but stated that there was no proper explanation for that within the docs. So that is what this change is aiming to solve!

I tried to be explicit enough in my explanation for the reason to be clear, but not too technical so newcomers can properly understand the problem. Let me know if I it needs change for it to be either clearer and more explicit or less technical and more friendly!

Changes

  1. https://github.com/jesi-rgb/p5.js/blob/21f5e3db573cad9ef4a00821a5468b31549656a6/src/image/image.js#L72
    1. Fixes an issue with the linter (adding parentheses to the division)
  2. https://github.com/jesi-rgb/p5.js/blob/21f5e3db573cad9ef4a00821a5468b31549656a6/src/image/image.js#L424
    3. Adds further explanation as to why the function works like this
  3. https://github.com/jesi-rgb/p5.js/blob/21f5e3db573cad9ef4a00821a5468b31549656a6/src/image/image.js#L435
    5. Adds further explanation in the arguments description to make sure people know what to expect.

Screenshots of the change:

The changes I added are highlighted.

image

image

PR Checklist

@welcome
Copy link

welcome bot commented Jun 19, 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!

@jesi-rgb jesi-rgb marked this pull request as ready for review June 19, 2022 10:09
@jesi-rgb jesi-rgb changed the title update documentation Update saveFrames documentation Jun 19, 2022
Copy link
Member

@limzykenneth limzykenneth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment inline

@@ -420,15 +420,20 @@ p5.prototype.saveGif = function(pImg, filename) {
* as an argument to the callback function as an array of objects, with the
* size of array equal to the total number of frames.
*
* Note that <a href="#/p5.Image/saveFrames">saveFrames()</a> will only save the first 15 frames of an animation.
* Note that <a href="#/p5.Image/saveFrames">saveFrames()</a> will only save the first 15 seconds of an animation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this line anymore with the explanations below.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jesi-rgb Still have this pending then we can merge.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it and also a minor typo!

@jesi-rgb
Copy link
Member Author

jesi-rgb commented Jul 1, 2022

Seems like this is already working fine! It let me commit with the correct configuration!

@jesi-rgb jesi-rgb requested a review from limzykenneth July 3, 2022 10:32
@limzykenneth limzykenneth merged commit f625ed4 into processing:main Jul 3, 2022
@limzykenneth
Copy link
Member

Looks good. Thanks!

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.

SaveFrames() misses some frames
2 participants