Skip to content

Commit

Permalink
Merge pull request #4 from noclocks/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jimbrig authored Mar 21, 2024
2 parents a343dd9 + dff9848 commit a2a84f2
Show file tree
Hide file tree
Showing 166 changed files with 8,134 additions and 0 deletions.
Binary file added images/clients/4thpark/4THPARK.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/clients/bastienlaw/favicon/favicon.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/clients/bastienlaw/featured/nursing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/clients/bastienlaw/logo/headline-logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/clients/lchc/logo/JPEG/LCHC_badge_navy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/clients/lchc/logo/JPEG/LCHC_icon_navy.jpg
Binary file added images/clients/lchc/logo/PNG/LCHC_badge_navy.png
Binary file added images/clients/lchc/logo/PNG/LCHC_icon_black.png
Binary file added images/clients/lchc/logo/PNG/LCHC_icon_ivory.png
Binary file added images/clients/lchc/logo/PNG/LCHC_icon_navy.png
Binary file added images/clients/lchc/logo/PNG/LCHC_icon_white.png
3,814 changes: 3,814 additions & 0 deletions images/clients/lchc/logo/SVG/lchc-badge-forest.svg

Large diffs are not rendered by default.

3,814 changes: 3,814 additions & 0 deletions images/clients/lchc/logo/SVG/lchc-logo-badge-navy.svg

Large diffs are not rendered by default.

Binary file added images/clients/lchc/logo/logo-badge.png
Binary file added images/clients/lchc/logo/logo-banner-navy.png
Binary file added images/clients/lchc/logo/logo-banner-white.png
Binary file added images/clients/lchc/logo/logo-banner.png
Binary file added images/featured/code-unsplash.jpg
Binary file added images/featured/r-pkgs.avif
Binary file not shown.
Binary file added images/featured/r-pkgs.png
Binary file added images/featured/r-pkgs.webp
Binary file not shown.
Binary file added logo/favicon.ico
Binary file not shown.
Binary file added logo/noclocks-logo-default-dark.png
Binary file added logo/noclocks-logo-default-light.png
Binary file added tools/png2svg/badge-navy.png
317 changes: 317 additions & 0 deletions tools/png2svg/badge-navy.svg

Large diffs are not rendered by default.

189 changes: 189 additions & 0 deletions tools/png2svg/png2svg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
#!/usr/bin/env bash
# -*- coding: utf-8 -*-

# ------------------------------------------------------------------------------
# _____
# / __ \
# _ __ _ __ __ _ `' / /'_____ ____ _
# | '_ \| '_ \ / _` | / / / __\ \ / / _` |
# | |_) | | | | (_| |./ /__\__ \\ V / (_| |
# | .__/|_| |_|\__, |\_____/___/ \_/ \__, |
# | | __/ | __/ |
# |_| |___/ |___/
#
# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
#
# SCRIPT NAME: png2svg.sh
#
# DESCRIPTION: Perform basic conversion of PNG images into SVG format
#
# USAGE:
#
# Save this script locally as "png2svg.sh" and make it executable:
# sudo chmod +x png2svg.sh
#
# Run the script in the following manner:
# ./png2svg.sh <file.png>
#
# This script can be run without verbosity with the following:
# sudo ./png2svg.sh --silent <file.png>
#
# Enable this script to have global execution availability by placing it
# into /usr/local/bin (or somewhere else in your user's PATH). By doing
# this, you can call "png2svg.sh" from anywhere on the system.
#
# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# VARIABLE DECLARATIONS & SET PIPEFAIL
# ------------------------------------------------------------------------------
set -Eeo pipefail
DEPENDS=("convert" "curl" "dos2unix" "potrace")
DEPENDS_REQ=""
V_X=""
V_S=""
# Remove the unused variable
# INPUT_X=""
INPUT_Y=""
INFO_SRC="https://pastebin.com/raw/VAnFpDLH"
VB_00="Beginning PNG conversion process. Please wait..."
VB_01="ERROR: A valid PNG image was not detected in your input parameters!"
VB_02="Please try again"
VB_03=" USAGE EXAMPLES: "
VB_04=" [ Verbose (Slow) ] --> ./png2svg.sh <file.png>"
VB_04B=" [ Piped Input v1 ] --> echo <file.png> | ./png2svg.sh"
VB_05=" [ Silent (Fast) ] --> ./png2svg.sh --silent <file.png>"
VB_05B=" [ Piped Input v2 ] --> echo <file.png> | ./png2svg.sh --silent"
VB_06=" [ Usage Examples ] --> ./png2svg.sh --help"
VB_07=" [ General Info ] --> ./png2svg.sh --info"
VB_08="ERR: Missing required package: "
VB_09="The following required packages are not installed on your system: "
VB_10="Terminating file conversion process."
VB_11="Done!"

#------------------------------------------------------------------------------#
# FUNCTION DECLARATIONS

function inputstream() {
# Write all incoming data into an array, "INST", to allow for both
# interactive and piped inputs in parent functions
INST=""
if [ -t 0 ]; then
local IN=($(echo -n "$@"))
else
local IN=($(</dev/stdin) $(echo -n "$@"))
fi
export INST=($(echo ${IN[@]}))
return
}

function n_tc() {
# Colorize text outputs
inputstream "$@"; local COLOR_FILTER=$(echo ${INST[@]})
echo -e "\e[34m${COLOR_FILTER}\e[39m"; return
}

function vb_out() {
# Output verbosity function
echo $(n_tc "[$0]")" $@"; return
}

function depends_check() {
# Make sure necessary software packages are present
TEST_A=$("$1" --version > /dev/null 2>&1; echo -n $?)
TEST_B=$("$1" -version > /dev/null 2>&1; echo -n $?)
if [[ ! "${TEST_A}" == "0" && ! "${TEST_B}" == "0" ]];
then echo "FALSE"
else echo "TRUE"
fi; return
}

function depends() {
# Core dependancy checking loop
for i in ${DEPENDS[@]};
do
case $(depends_check "$i") in
FALSE) vb_out "${VB_08}$i"; DEPENDS_REQ+=( "$i" ) ;;
esac
done
if [[ $(echo "${DEPENDS_REQ[@]}") =~ [A-Za-z0-9] ]];
then
vb_out "${VB_09}"
for i in "${DEPENDS_REQ[@]}"; do n_tc "$i"; done
echo; read -p "Would you like to install them? [y/n]: " -n 1 -r
echo "" # insert new line
if [[ $REPLY =~ ^[Yy]$ ]];
then
clear; echo $(vb_out "Installing ${DEPENDS_REQ[@]}")" Please wait..."
sudo apt-get update
for i in ${DEPENDS_REQ[@]}; do sudo apt-get install -y $i; done; clear
else
vb_out "${VB_10}"; exit 1
fi
fi
return
}

function help_p2s() {
# Print the png2svg help text
echo; echo "${VB_03}"; echo
echo "${VB_04}"; echo "${VB_04B}"
echo "${VB_05}"; echo "${VB_05B}"
echo "${VB_06}"; echo "${VB_07}"
echo; return
}

#------------------------------------------------------------------------------#
# EXECUTE CORE OPERATIONS

inputstream "$@"; INPUT_VARS=( $(echo ${INST[@]}) )
case "$1" in
-h|-help|--help) help_p2s; exit 0 ;;
-i|-info|--info)
depends; curl -s ${INFO_SRC} | dos2unix; echo; exit 0
;;
-q|--quiet|-quiet|-s|--silent|-silent)
V_X="/dev/null"; V_S="sleep 0"
;;
*|'')
if [[ "x${INPUT_VARS}" == "x" ]]; then help_p2s; exit 0
else V_X="/dev/stdout"; V_S="sleep 0.5"; fi
;;
esac

depends; vb_out ${VB_00} &>${V_X}; ${V_S}

if [[ $(echo "${#INPUT_VARS[@]}") -gt 1 ]];
then
touch .tempfile; INPUT_T=".tempfile"
for i in "${INPUT_VARS[@]}";
do
if [[ -f "$i" && "$i" =~ \.png$ ]]; then echo -n "$i" > ${INPUT_T}; fi
done
INPUT_Y=$(cat ${INPUT_T})
if [[ "x${INPUT_Y}" == "x" ]];
then
vb_out "${VB_01}" &>${V_X}; vb_out "${VB_02}" &>${V_X}
help_p2s &>${V_X}; ${V_S}; exit 1
else
convert -flatten "${INPUT_Y}" "temp.ppm" &>${V_X}; ${V_S}
potrace -s "temp.ppm" -o "${INPUT_Y%.*}.svg" &>${V_X}; ${V_S}
rm temp.ppm &>/dev/null; rm ${INPUT_T} &>/dev/null
vb_out "${VB_11}" &>${V_X}; ${V_S}
fi
exit 0
else
INPUT_1=$(if [[ -f ${INPUT_VARS} && ${INPUT_VARS} =~ \.png$ ]]; then echo -n TRUE; else echo -n; fi)
if [[ "x${INPUT_1}" == "x" ]];
then
vb_out "${VB_01}" &>${V_X}; vb_out "${VB_02}" &>${V_X}
help_p2s &>${V_X}; ${V_S}; exit 1
else
convert -flatten "${INPUT_VARS}" "temp.ppm" &>${V_X}; ${V_S}
potrace -s "temp.ppm" -o "${INPUT_VARS%.*}.svg" &>${V_X}; ${V_S}
rm temp.ppm &>/dev/null; vb_out "${VB_11}" &>${V_X}; ${V_S}
fi
exit 0
fi

0 comments on commit a2a84f2

Please sign in to comment.