Skip to content

Commit 87ce681

Browse files
fix syntax
1 parent 100d064 commit 87ce681

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/mindee/image/image_extractor.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ def self.extract_multiple_images_from_source(input_source, page_id, polygons)
4949
def self.extract_images_from_polygons(input_source, page_id, polygons)
5050
extracted_elements = [] # @type var extracted_elements: Array[Image::ExtractedImage]
5151

52+
input_source.io_stream.rewind
53+
pdf_stream = StringIO.new(input_source.io_stream.read.to_s)
54+
input_source.io_stream.rewind
5255
polygons.each_with_index do |polygon, element_id|
5356
polygon = ImageUtils.normalize_polygon(polygon)
54-
input_source.io_stream.rewind
55-
pdf_stream = StringIO.new(input_source.io_stream.read.to_s)
5657
page_content = ImageUtils.read_page_content(pdf_stream)
5758
points = [
5859
polygon.top_left,

0 commit comments

Comments
 (0)