Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix filter parameter in toBuffer method #356

Merged
merged 1 commit into from

3 participants

@selaux

I tried to write a png to disk using a custom compressionLevel and filter method. But it always failed with libpng error: Unknown row filter for method 0. I found this line in the code and it seems to me that the filter is using the wrong index for the parameter (args[1] is compressionLevel). So I fixed it.

@selaux selaux referenced this pull request in selaux/node-sprite-generator
Closed

Allow user to specify png filter option #10

@selaux

Any thoughts?

@kkoopa

Yes, you are definitely correct, the rows around check for the correct index, I must have been sloppy writing that, looks like bad copypasta.

@selaux selaux referenced this pull request in selaux/node-sprite-generator
Closed

Change compression to 0-100, update docs. #12

@kangax kangax merged commit 5cc0a5f into Automattic:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 14, 2013
  1. @selaux
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/Canvas.cc
View
2  src/Canvas.cc
@@ -277,7 +277,7 @@ NAN_METHOD(Canvas::ToBuffer) {
if (!args[2]->StrictEquals(Undefined())) {
if (args[2]->IsUint32()) {
- filter = args[1]->Uint32Value();
+ filter = args[2]->Uint32Value();
} else {
return NanThrowTypeError("Invalid filter value.");
}
Something went wrong with that request. Please try again.