mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
fix progressive typo
This commit is contained in:
parent
2e427bb28a
commit
f68ba8ea57
18
src/sharp.cc
18
src/sharp.cc
@ -22,7 +22,7 @@ struct resize_baton {
|
|||||||
bool crop;
|
bool crop;
|
||||||
VipsExtend extend;
|
VipsExtend extend;
|
||||||
bool sharpen;
|
bool sharpen;
|
||||||
bool progessive;
|
bool progressive;
|
||||||
VipsAccess access_method;
|
VipsAccess access_method;
|
||||||
int quality;
|
int quality;
|
||||||
int compressionLevel;
|
int compressionLevel;
|
||||||
@ -178,7 +178,7 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
factor = std::max(factor, 1.0);
|
factor = std::max(factor, 1.0);
|
||||||
shrink = floor(factor);
|
shrink = floor(factor);
|
||||||
residual = shrink / factor;
|
residual = shrink / factor;
|
||||||
// Reload input using shrink-on-load
|
// Reload input using shrink-on-load
|
||||||
if (baton->buffer_in_len > 1) {
|
if (baton->buffer_in_len > 1) {
|
||||||
if (vips_jpegload_buffer(baton->buffer_in, baton->buffer_in_len, &shrunk_on_load, "shrink", shrink_on_load, NULL)) {
|
if (vips_jpegload_buffer(baton->buffer_in, baton->buffer_in_len, &shrunk_on_load, "shrink", shrink_on_load, NULL)) {
|
||||||
return resize_error(baton, in);
|
return resize_error(baton, in);
|
||||||
@ -261,12 +261,12 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
// Output
|
// Output
|
||||||
if (baton->file_out == "__jpeg" || (baton->file_out == "__input" && inputImageType == JPEG)) {
|
if (baton->file_out == "__jpeg" || (baton->file_out == "__input" && inputImageType == JPEG)) {
|
||||||
// Write JPEG to buffer
|
// Write JPEG to buffer
|
||||||
if (vips_jpegsave_buffer(sharpened, &baton->buffer_out, &baton->buffer_out_len, "strip", TRUE, "Q", baton->quality, "optimize_coding", TRUE, "interlace", baton->progessive, NULL)) {
|
if (vips_jpegsave_buffer(sharpened, &baton->buffer_out, &baton->buffer_out_len, "strip", TRUE, "Q", baton->quality, "optimize_coding", TRUE, "interlace", baton->progressive, NULL)) {
|
||||||
return resize_error(baton, sharpened);
|
return resize_error(baton, sharpened);
|
||||||
}
|
}
|
||||||
} else if (baton->file_out == "__png" || (baton->file_out == "__input" && inputImageType == PNG)) {
|
} else if (baton->file_out == "__png" || (baton->file_out == "__input" && inputImageType == PNG)) {
|
||||||
// Write PNG to buffer
|
// Write PNG to buffer
|
||||||
if (vips_pngsave_buffer(sharpened, &baton->buffer_out, &baton->buffer_out_len, "strip", TRUE, "compression", baton->compressionLevel, "interlace", baton->progessive, NULL)) {
|
if (vips_pngsave_buffer(sharpened, &baton->buffer_out, &baton->buffer_out_len, "strip", TRUE, "compression", baton->compressionLevel, "interlace", baton->progressive, NULL)) {
|
||||||
return resize_error(baton, sharpened);
|
return resize_error(baton, sharpened);
|
||||||
}
|
}
|
||||||
} else if (baton->file_out == "__webp" || (baton->file_out == "__input" && inputImageType == WEBP)) {
|
} else if (baton->file_out == "__webp" || (baton->file_out == "__input" && inputImageType == WEBP)) {
|
||||||
@ -276,12 +276,12 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
}
|
}
|
||||||
} else if (is_jpeg(baton->file_out)) {
|
} else if (is_jpeg(baton->file_out)) {
|
||||||
// Write JPEG to file
|
// Write JPEG to file
|
||||||
if (vips_jpegsave(sharpened, baton->file_out.c_str(), "strip", TRUE, "Q", baton->quality, "optimize_coding", TRUE, "interlace", baton->progessive, NULL)) {
|
if (vips_jpegsave(sharpened, baton->file_out.c_str(), "strip", TRUE, "Q", baton->quality, "optimize_coding", TRUE, "interlace", baton->progressive, NULL)) {
|
||||||
return resize_error(baton, sharpened);
|
return resize_error(baton, sharpened);
|
||||||
}
|
}
|
||||||
} else if (is_png(baton->file_out)) {
|
} else if (is_png(baton->file_out)) {
|
||||||
// Write PNG to file
|
// Write PNG to file
|
||||||
if (vips_pngsave(sharpened, baton->file_out.c_str(), "strip", TRUE, "compression", baton->compressionLevel, "interlace", baton->progessive, NULL)) {
|
if (vips_pngsave(sharpened, baton->file_out.c_str(), "strip", TRUE, "compression", baton->compressionLevel, "interlace", baton->progressive, NULL)) {
|
||||||
return resize_error(baton, sharpened);
|
return resize_error(baton, sharpened);
|
||||||
}
|
}
|
||||||
} else if (is_webp(baton->file_out)) {
|
} else if (is_webp(baton->file_out)) {
|
||||||
@ -323,7 +323,7 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
|
|
||||||
NAN_METHOD(resize) {
|
NAN_METHOD(resize) {
|
||||||
NanScope();
|
NanScope();
|
||||||
|
|
||||||
resize_baton *baton = new resize_baton;
|
resize_baton *baton = new resize_baton;
|
||||||
baton->file_in = *String::Utf8Value(args[0]->ToString());
|
baton->file_in = *String::Utf8Value(args[0]->ToString());
|
||||||
if (args[1]->IsObject()) {
|
if (args[1]->IsObject()) {
|
||||||
@ -345,7 +345,7 @@ NAN_METHOD(resize) {
|
|||||||
baton->extend = VIPS_EXTEND_BLACK;
|
baton->extend = VIPS_EXTEND_BLACK;
|
||||||
}
|
}
|
||||||
baton->sharpen = args[6]->BooleanValue();
|
baton->sharpen = args[6]->BooleanValue();
|
||||||
baton->progessive = args[7]->BooleanValue();
|
baton->progressive = args[7]->BooleanValue();
|
||||||
baton->access_method = args[8]->BooleanValue() ? VIPS_ACCESS_SEQUENTIAL : VIPS_ACCESS_RANDOM;
|
baton->access_method = args[8]->BooleanValue() ? VIPS_ACCESS_SEQUENTIAL : VIPS_ACCESS_RANDOM;
|
||||||
baton->quality = args[9]->Int32Value();
|
baton->quality = args[9]->Int32Value();
|
||||||
baton->compressionLevel = args[10]->Int32Value();
|
baton->compressionLevel = args[10]->Int32Value();
|
||||||
@ -358,7 +358,7 @@ NAN_METHOD(resize) {
|
|||||||
|
|
||||||
NAN_METHOD(cache) {
|
NAN_METHOD(cache) {
|
||||||
NanScope();
|
NanScope();
|
||||||
|
|
||||||
// Set cache limit
|
// Set cache limit
|
||||||
if (args[0]->IsInt32()) {
|
if (args[0]->IsInt32()) {
|
||||||
vips_cache_set_max_mem(args[0]->Int32Value() * 1048576);
|
vips_cache_set_max_mem(args[0]->Int32Value() * 1048576);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user