Skip to content

Commit

Permalink
Comments resolve for libvips text api
Browse files Browse the repository at this point in the history
  • Loading branch information
brahima committed Jul 15, 2022
1 parent bd013c7 commit 0fa6531
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/common.cc
Expand Up @@ -142,9 +142,6 @@ namespace sharp {
if (HasAttr(input, "textFontfile")) {
descriptor->textFontfile = AttrAsStr(input, "textFontfile");
}
if (HasAttr(input, "textFontfile")) {
descriptor->textFontfile = AttrAsStr(input, "textFontfile");
}
if (HasAttr(input, "textWidth")) {
descriptor->textWidth = AttrAsUint32(input, "textWidth");
}
Expand Down Expand Up @@ -453,8 +450,10 @@ namespace sharp {
if (descriptor->textFontfile.length() > 0) {
textOptions->set("fontfile", const_cast<char*>(descriptor->textFontfile.data()));
}
image = VImage::new_memory().text(const_cast<char *>(descriptor->textValue.data()), textOptions);
image.get_image()->Type = image.guess_interpretation();
image = VImage::text(const_cast<char *>(descriptor->textValue.data()), textOptions);
if (!descriptor->textRgba) {
image = image.copy(VImage::option()->set("interpretation", VIPS_INTERPRETATION_B_W));
}
imageType = ImageType::RAW;
} else {
// From filesystem
Expand Down

0 comments on commit 0fa6531

Please sign in to comment.