<commit_before>#!/bin/bash

TEMP_FILE_1=tmp1.png
TEMP_FILE_2=tmp2.png
BASE_PATH=/var/www/dev.dosomething.org/lib/modules/dosomething/dosomething_campaign/dosomething_campaign_problem_shares/
FINAL_FILE=$BASE_PATH/images/$1.jpg

convert \
  -size 471x248 \
  canvas:#23B7FB \
  -fill "#337D9F" \
  -pointsize 16 \
  -font $BASE_PATH/fonts/ProximaNova-Bold.otf \
  -annotate +20+40 'make a difference' \
  $TEMP_FILE_1

convert \
  -background transparent \
  -size 431x228 \
  -fill white \
  -font $BASE_PATH/fonts/ProximaNova-Reg.otf \
  -pointsize 24 \
  caption:"$2" \
  $TEMP_FILE_2 \

composite \
  $TEMP_FILE_2 \
  -gravity northwest \
  -geometry +20+50 \
  $TEMP_FILE_1 \
  $FINAL_FILE

rm $TEMP_FILE_1
rm $TEMP_FILE_2<commit_msg>Programatically finding full path to font files<commit_after>#!/bin/bash

TEMP_FILE_1=tmp1.png
TEMP_FILE_2=tmp2.png
BOLD_FONT_PATH=`/usr/bin/find /var/www -name "ProximaNova-Bold.otf"`
REG_FONT_PATH=`/usr/bin/find /var/www -name "ProximaNova-Reg.otf"`
FINAL_FILE=`/usr/bin/find /var/www -type d -name "dosomething_campaign_problem_shares"`/images/$1.jpg

convert \
  -size 471x248 \
  canvas:#23B7FB \
  -fill "#337D9F" \
  -pointsize 16 \
  -font $BOLD_FONT_PATH \
  -annotate +20+40 'Make a Difference' \
  $TEMP_FILE_1

convert \
  -background transparent \
  -size 431x228 \
  -fill white \
  -font $REG_FONT_PATH \
  -pointsize 24 \
  caption:"$2" \
  $TEMP_FILE_2 \

composite \
  $TEMP_FILE_2 \
  -gravity northwest \
  -geometry +20+50 \
  $TEMP_FILE_1 \
  $FINAL_FILE

rm $TEMP_FILE_1
rm $TEMP_FILE_2
{'fraction_non_alphanumeric': 0.1305753070458953, 'fraction_numerical': 0.055591467356173235, 'mean_word_length': 3.36056338028169, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '835821', 'n_tokens_mistral': 727, 'n_tokens_neox': 663, 'n_words': 109}