use new_from_memory_copy

This commit is contained in:
Pete Matsyburka
2026-05-31 14:28:35 +03:00
parent d5738a0631
commit 9fcaef4cf7
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -193,7 +193,7 @@ module Templates
data, width, height = page.render_to_bitmap(size_key => size)
Vips::Image.new_from_memory(data, width, height, 4, :uchar)
Vips::Image.new_from_memory_copy(data, width, height, 4, :uchar)
end
def sort_fields(fields, y_threshold: 0.01)
+2 -2
View File
@@ -107,7 +107,7 @@ module Templates
bytes, width, height = doc_page.render_to_bitmap(width: MAX_WIDTH)
image = Vips::Image.new_from_memory(bytes, width, height, 4, :uchar)
image = Vips::Image.new_from_memory_copy(bytes, width, height, 4, :uchar)
Concurrent::Promise.execute(executor: pool) { build_and_upload_blob(image, page_number) }
ensure
@@ -201,7 +201,7 @@ module Templates
doc_page.close
image = Vips::Image.new_from_memory(bytes, width, height, 4, :uchar)
image = Vips::Image.new_from_memory_copy(bytes, width, height, 4, :uchar)
blob = build_and_upload_blob(image, page_number, PREVIEW_FORMAT)