SPONSOR_NAME=$(echo $SPONSOR | cut -d ':' -f 1)
SPONSOR_URL=$(echo $SPONSOR | cut -d ':' -f 2)
SPONSOR_IMG=$(echo $SPONSOR | cut -d ':' -f 3)
- echo "Generating head image for sponsor $SPONSOR_NAME with image $SPONSOR_IMG and URL $SPONSOR_URL"
+ SPONSOR_IMG_W=$(magick identify -format "%[fx:w]" "../../logos/$SPONSOR_IMG")
+ SPONSOR_IMG_H=$(magick identify -format "%[fx:h]" "../../logos/$SPONSOR_IMG")
+ echo "Generating head image for sponsor $SPONSOR_NAME with image $SPONSOR_IMG (${SPONSOR_IMG_W}x${SPONSOR_IMG_H}) and URL $SPONSOR_URL"
cp "./ogp-interview.svg" "./ogp-interview-${SPONSOR_URL}.svg"
+ convert "../../logos/$SPONSOR_IMG" -resize 550x120 -background white -compose Copy -gravity center -extent 550x120 "./$SPONSOR_IMG"
sed -i "s|LOGO.png|$SPONSOR_IMG|" "./ogp-interview-${SPONSOR_URL}.svg"
sed -i "s|PAGE_URL|sponsor-interviews/$SPONSOR_URL/|" "./ogp-interview-${SPONSOR_URL}.svg"
inkscape --export-type="png" --export-area-page --export-filename "../sponsor-interview-${SPONSOR_URL}.png" "./ogp-interview-${SPONSOR_URL}.svg"
rm "./ogp-interview-${SPONSOR_URL}.svg"
+ rm "./$SPONSOR_IMG"
done
# Pages
height="120"
image-rendering="optimizeQuality"
stroke-width="0.194169"
- xlink:href="../../logos/LOGO.png"
- preserveAspectRatio="xMidYMid meet"
+ xlink:href="LOGO.png"
+ preserveAspectRatio="none"
id="image77" /></svg>