Add flag to flip speech bubble
This commit is contained in:
parent
b298656515
commit
bb966df085
2 changed files with 12 additions and 1 deletions
|
@ -24,6 +24,8 @@ Napi::Value Watermark(const Napi::CallbackInfo &info) {
|
|||
: false;
|
||||
bool alpha =
|
||||
obj.Has("alpha") ? obj.Get("alpha").As<Napi::Boolean>().Value() : false;
|
||||
bool flip =
|
||||
obj.Has("flip") ? obj.Get("flip").As<Napi::Boolean>().Value() : false;
|
||||
bool mc = obj.Has("mc") ? obj.Get("mc").As<Napi::Boolean>().Value() : false;
|
||||
string basePath = obj.Get("basePath").As<Napi::String>().Utf8Value();
|
||||
string type = obj.Get("type").As<Napi::String>().Utf8Value();
|
||||
|
@ -43,6 +45,10 @@ Napi::Value Watermark(const Napi::CallbackInfo &info) {
|
|||
int pageHeight = vips_image_get_page_height(in.get_image());
|
||||
int nPages = vips_image_get_n_pages(in.get_image());
|
||||
|
||||
if (flip) {
|
||||
watermark = watermark.flip(VIPS_DIRECTION_HORIZONTAL);
|
||||
}
|
||||
|
||||
if (resize && append) {
|
||||
watermark = watermark.resize((double)width / (double)watermark.width());
|
||||
} else if (resize && yscale) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue