exceed memory limit
#3740
-
I have a 32-bit program use this code.
How can i make it run correctly? |
Beta Was this translation helpful? Give feedback.
Answered by
jcupitt
Oct 30, 2023
Replies: 1 comment 1 reply
-
Hello @qtbui159, The https://www.libvips.org/API/current/libvips-draw.html#libvips-draw.description To paste one image into another, use 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 ... } It'll run in very little memory, and it'll use all your CPU cores. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
qtbui159
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.:I…