Skip to content

Commit f625ed4

Browse files
authored
Merge pull request #5694 from jesi-rgb/save-frames-doc-update
Update `saveFrames` documentation
2 parents b3f0c29 + 9808118 commit f625ed4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/image/image.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,19 @@ p5.prototype.saveGif = function(pImg, filename) {
420420
* as an argument to the callback function as an array of objects, with the
421421
* size of array equal to the total number of frames.
422422
*
423-
* Note that <a href="#/p5.Image/saveFrames">saveFrames()</a> will only save the first 15 frames of an animation.
423+
* The arguments `duration` and `framerate` are constrained to be less or equal to 15 and 22, respectively, which means you
424+
* can only download a maximum of 15 seconds worth of frames at 22 frames per second, adding up to 330 frames.
425+
* This is done in order to avoid memory problems since a large enough canvas can fill up the memory in your computer
426+
* very easily and crash your program or even your browser.
427+
*
424428
* To export longer animations, you might look into a library like
425429
* <a href="https://github.com/spite/ccapture.js/">ccapture.js</a>.
426430
*
427431
* @method saveFrames
428432
* @param {String} filename
429433
* @param {String} extension 'jpg' or 'png'
430-
* @param {Number} duration Duration in seconds to save the frames for.
431-
* @param {Number} framerate Framerate to save the frames in.
434+
* @param {Number} duration Duration in seconds to save the frames for. This parameter will be constrained to be less or equal to 15.
435+
* @param {Number} framerate Framerate to save the frames in. This parameter will be constrained to be less or equal to 22.
432436
* @param {function(Array)} [callback] A callback function that will be executed
433437
to handle the image data. This function
434438
should accept an array as argument. The

0 commit comments

Comments
 (0)