processing / p5.js-website

New p5.js website!
http://p5js.org
MIT License
18 stars 92 forks source link

Add webp as accepted file formats #451

Closed starzonmyarmz closed 4 months ago

starzonmyarmz commented 4 months ago

saveCanvas() does allow you to save the canvas as a webp file. I think the documentation should reflect this.

Qianqianye commented 4 months ago

Thanks @starzonmyarmz! I'm tagging the reference technical writer @nickmcintyre to take a look at this. Also, to make changes on p5.js reference, we will need to make a pull request on p5.js library repo. In this case, the documentation for saveCanvas() is here.

nickmcintyre commented 4 months ago

Good catch @starzonmyarmz! Would you please update the parameter descriptions here as well?

When you make the pull request in the p5.js library repo, please also have a look at the mimeType variable declared on line 312. The switch statement needs another case for 'image/webp'. A quick test confirmed that saveCanvas('myCanvas.webp') outputs a file with the MIME type image/png.

starzonmyarmz commented 4 months ago

Updated p5.js library: https://github.com/processing/p5.js/pull/7140.

Qianqianye commented 4 months ago

Thanks @starzonmyarmz. We will handle this in the PR on p5.js library repo https://github.com/processing/p5.js/pull/7140. I will close this one for organizational purpose.