Skip to content

Commit

Permalink
Merge pull request #6726 from mohitbalwani/undefined-height-bug
Browse files Browse the repository at this point in the history
Add required parameters in _flipPixels function
  • Loading branch information
davepagurek authored Jan 17, 2024
2 parents b2da2ed + 58821e2 commit d04d3b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/image/loading_displaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ p5.prototype.saveGif = async function(
pixels
);

data = _flipPixels(pixels);
data = _flipPixels(pixels, this.width, this.height);
} else {
data = this.drawingContext.getImageData(0, 0, this.width, this.height)
.data;
Expand Down Expand Up @@ -507,7 +507,7 @@ p5.prototype.saveGif = async function(
p5.prototype.downloadFile(blob, fileName, extension);
};

function _flipPixels(pixels) {
function _flipPixels(pixels, width, height) {
// extracting the pixels using readPixels returns
// an upside down image. we have to flip it back
// first. this solution is proposed by gman on
Expand Down

0 comments on commit d04d3b2

Please sign in to comment.