Skip to content

exceed memory limit #3740

Answered by jcupitt
qtbui159 asked this question in Q&A
Oct 30, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hello @qtbui159,

The draw_*() functions are there for paintbox-style programs which need to make small, in-place, iterative modifications to an image, so they need to keep the whole thing in memory. They can't do large images, and they are not threaded.

https://www.libvips.org/API/current/libvips-draw.html#libvips-draw.description

To paste one image into another, use insert, eg.:

VipsImage* big = vips_image_new_from_file("C:\\Users\\Spike\\Desktop\\2-12.jpg", nullptr); // 30000x20000 jpg
VipsImage* small = vips_image_new_from_file("C:\\Users\\Spike\\Desktop\\ffsc.jpg", nullptr); // 1080x2400 jpg
VipsImage *out;
if (vips_insert(big, small, &out, 0, 0, nullptr)) { ... error handling ... }

I…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@qtbui159
Comment options

Answer selected by qtbui159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3739 on October 30, 2023 12:46.