Skip to content

Error: Width and height must be set prior to rendering #109

@ghost

Description

I get this error with p5.js.

<script src="CCapture.all.min.js"></script>

<script>
		var capturer = new CCapture( {
			 format: 'gif', 
			 workersPath: 'js/gif.worker.js',
		} );

                var width = 300;
		var height = 500;

		function setup () {
			p5canvas = createCanvas(width,height);
		}
               function draw () {
               // code
               		if (frameCount === 0)  capturer.start();
			
			if (frameCount <= 100) {
				capturer.capture(p5canvas);
				console.log(frameCount);
			} else {
				capturer.stop();
				capturer.save();
			}
               }
Error: Width and height must be set prior to rendering CCapture.all.min.js:1:16873
    render file:///C:/Users/admin/Documents/Cubase Projects/Untitled-31/Video/CCapture.all.min.js:1
    save file:///C:/Users/admin/Documents/Cubase Projects/Untitled-31/Video/CCapture.all.min.js:2
    v file:///C:/Users/admin/Documents/Cubase Projects/Untitled-31/Video/CCapture.all.min.js:1
    draw file:///C:/Users/admin/Documents/Cubase Projects/Untitled-31/Video/index.html:66
    redraw file:///C:/Users/admin/Documents/Cubase Projects/Untitled-31/Video/p5.min.js:3
    _draw file:///C:/Users/admin/Documents/Cubase Projects/Untitled-31/Video/p5.min.js:3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions