@@ -313,7 +313,7 @@ def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is
313313 attachments_data_cache [ attachment . uuid ] ||= attachment . download
314314
315315 ImageUtils . load_vips ( attachments_data_cache [ attachment . uuid ] ,
316- content_type : attachment . content_type ) . autorot
316+ content_type : attachment . content_type , autorot : true )
317317 rescue Vips ::Error
318318 next unless attachment . content_type . starts_with? ( 'image/' )
319319 next if attachment . byte_size . zero?
@@ -358,7 +358,8 @@ def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is
358358 image_x = area_x + ( ( half_width - image_width ) / 2.0 )
359359 image_y = height - area_y - image_height
360360
361- io = StringIO . new ( image . resize ( [ scale * 4 , 1 ] . select ( &:positive? ) . min ) . write_to_buffer ( '.png' ) )
361+ io =
362+ StringIO . new ( image . resize ( [ scale * 4 , 1 ] . select ( &:positive? ) . min ) . write_to_buffer ( '.png' , strip : true ) )
362363
363364 canvas . image ( io , at : [ image_x , image_y ] , width : image_width , height : image_height )
364365
@@ -425,7 +426,8 @@ def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is
425426
426427 scale = [ area_w / image . width , image_height / image . height ] . min
427428
428- io = StringIO . new ( image . resize ( [ scale * 4 , 1 ] . select ( &:positive? ) . min ) . write_to_buffer ( '.png' ) )
429+ io =
430+ StringIO . new ( image . resize ( [ scale * 4 , 1 ] . select ( &:positive? ) . min ) . write_to_buffer ( '.png' , strip : true ) )
429431
430432 layouter . fit ( [ text ] , area_w , base_font_size / 0.65 )
431433 . draw ( canvas , area_x + TEXT_LEFT_MARGIN ,
@@ -454,7 +456,7 @@ def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is
454456 attachments_data_cache [ attachment . uuid ] ||= attachment . download
455457
456458 ImageUtils . load_vips ( attachments_data_cache [ attachment . uuid ] ,
457- content_type : attachment . content_type ) . autorot
459+ content_type : attachment . content_type , autorot : true )
458460 rescue Vips ::Error
459461 next unless attachment . content_type . starts_with? ( 'image/' )
460462 next if attachment . byte_size . zero?
@@ -471,7 +473,7 @@ def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is
471473 if field_type == 'image' && !resized_image . has_alpha?
472474 StringIO . new ( resized_image . colourspace ( :srgb ) . write_to_buffer ( '.jpg' , strip : true ) )
473475 else
474- StringIO . new ( resized_image . write_to_buffer ( '.png' ) )
476+ StringIO . new ( resized_image . write_to_buffer ( '.png' , strip : true ) )
475477 end
476478
477479 canvas . image (
0 commit comments