1e5c31af7Sopenharmony_ci#!/bin/bash
2e5c31af7Sopenharmony_ci# Copyright 2014-2024 The Khronos Group Inc.
3e5c31af7Sopenharmony_ci# SPDX-License-Identifier: Apache-2.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci# makedocinfologo - generate HTML docinfo file from an SVG image.
6e5c31af7Sopenharmony_ci# Usage: makedocinfologo file.svg alt-text > docinfo-header.html
7e5c31af7Sopenharmony_ci# Example: makedocinfologo ../images/vulkansc-unscaled.svg "Vulkan SC Logo" > vulkansc/docinfo-header.html
8e5c31af7Sopenharmony_ci
9e5c31af7Sopenharmony_cifile=$1
10e5c31af7Sopenharmony_ciif test ! -r "$file" ; then
11e5c31af7Sopenharmony_ci    echo "Cannot read SVG file: $file" > /dev/stderr
12e5c31af7Sopenharmony_ci    exit 1
13e5c31af7Sopenharmony_cifi
14e5c31af7Sopenharmony_ci#echo "file: $file" > /dev/stderr
15e5c31af7Sopenharmony_cialt=${2-$file}
16e5c31af7Sopenharmony_ci#echo "alt: $alt" > /dev/stderr
17e5c31af7Sopenharmony_ci
18e5c31af7Sopenharmony_ciecho '<div style="text-align: center;">'
19e5c31af7Sopenharmony_ciecho -n '    <span class="image"><img src="data:image/svg+xml;base64,'
20e5c31af7Sopenharmony_cibase64 $1 | tr -d '\n'
21e5c31af7Sopenharmony_ciecho '" alt="'$2'" width="50%">'
22e5c31af7Sopenharmony_ciecho '    </span>'
23e5c31af7Sopenharmony_ciecho '</div>'
24