mirror of
https://github.com/lovell/sharp.git
synced 2026-02-11 00:56:14 +01:00
committed by
Lovell Fuller
parent
673d8278b5
commit
b69627891d
@@ -56,6 +56,7 @@ using sharp::EntropyCrop;
|
||||
using sharp::TileCache;
|
||||
using sharp::Threshold;
|
||||
using sharp::Bandbool;
|
||||
using sharp::Trim;
|
||||
|
||||
using sharp::ImageType;
|
||||
using sharp::ImageTypeId;
|
||||
@@ -207,6 +208,11 @@ class PipelineWorker : public AsyncWorker {
|
||||
RemoveExifOrientation(image);
|
||||
}
|
||||
|
||||
// Trim
|
||||
if(baton->trimTolerance != 0) {
|
||||
image = Trim(image, baton->trimTolerance);
|
||||
}
|
||||
|
||||
// Pre extraction
|
||||
if (baton->topOffsetPre != -1) {
|
||||
image = image.extract_area(baton->leftOffsetPre, baton->topOffsetPre, baton->widthPre, baton->heightPre);
|
||||
@@ -1145,6 +1151,10 @@ NAN_METHOD(pipeline) {
|
||||
baton->sharpenJagged = attrAs<double>(options, "sharpenJagged");
|
||||
baton->threshold = attrAs<int32_t>(options, "threshold");
|
||||
baton->thresholdGrayscale = attrAs<bool>(options, "thresholdGrayscale");
|
||||
baton->trimTolerance = attrAs<int32_t>(options, "trimTolerance");
|
||||
if(baton->accessMethod == VIPS_ACCESS_SEQUENTIAL && baton->trimTolerance != 0) {
|
||||
baton->accessMethod = VIPS_ACCESS_RANDOM;
|
||||
}
|
||||
baton->gamma = attrAs<double>(options, "gamma");
|
||||
baton->greyscale = attrAs<bool>(options, "greyscale");
|
||||
baton->normalize = attrAs<bool>(options, "normalize");
|
||||
|
||||
Reference in New Issue
Block a user