Skip to content

Commit

Permalink
(core) Specify when generate thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
malkoG committed Aug 3, 2024
1 parent be42348 commit d2ec695
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/utils/opengraph/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def image(source, resize_with_ratio:)
self
end

def text(message, width:, height:, dpi: 300, color: '#2f363d', font: 'Open Sans Bold')
def text(message, width:, height:, dpi: 300, color: '#2f363d', font: 'Open Sans Bold', font_size: 12)
font_size = font_size || 12 # Default font size if not specified
im = Vips::Image.text(message, width: width, height: height, dpi: dpi, font: "#{font}:#{font_size}")
im = Vips::Image.text(message, width: width, height: height, dpi: dpi, font: font)
im = im.new_from_image(hex_to_rgb(color)).copy(interpretation: :srgb).bandjoin(im)
@elements << im
Expand Down

0 comments on commit d2ec695

Please sign in to comment.