From 4d347b9800cf5c070e4c2e0e17d2ada0443489a0 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 22 Sep 2013 08:51:56 +0200 Subject: [PATCH] Tuning to automatic font size for portrait images --- meme.fcgi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meme.fcgi b/meme.fcgi index 0296168..6624161 100755 --- a/meme.fcgi +++ b/meme.fcgi @@ -115,6 +115,11 @@ while (my $q = new CGI::Fast) { $divisions = @lines if @lines > $divisions; my $fontsize = int($height/$divisions + 0.5); + if ($fontsize > $width/10) { + $fontsize = int($width/10 + 0.5) if $fontsize > $width/10; + $divisions = int($height/$fontsize + 0.5); + } + my $offset = int(100/$divisions + 0.5); my $fillers = grep { $_ eq '' } @lines; my $real_lines = @lines - $fillers; -- 2.32.0.93.g670b81a890