Don't crop if image isn't a GIF

This commit is contained in:
Essem 2022-02-16 12:25:43 -06:00
parent 2c60e404a4
commit 50ef9e51be
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -55,7 +55,7 @@ Napi::Value Caption(const Napi::CallbackInfo &info) {
vector<VImage> img;
for (int i = 0; i < n_pages; i++) {
VImage img_frame = in.crop(0, i * page_height, width, page_height);
VImage img_frame = type == "gif" ? in.crop(0, i * page_height, width, page_height) : in;
VImage frame = captionImage.join(img_frame,
VIPS_DIRECTION_VERTICAL, VImage::option()
->set("background", 0xffffff)