#!/bin/sh
#] 
#] *********************
#] $ "$d_bin"'image library.sh'  - using [gimp, gnuplot, imagemagic, pqiv]
# www.BillHowell.ca  31May2025 initial 
# view in text editor, using constant-width font (eg courier), tabWidth = 3


# pinn_arcArch  "$d_bin"'image library.sh'
#24************************24




#24************************24
# List of operators, generated with :
# $ grep  "^#]"  "$d_bin"'image library.sh' |  sed "s/^#\]/  /"  >"$d_bin"'image library.sh'' TblOfCont.txt' 
# REPL $ sudo pinn_arcArch  "$d_bin"'image library.txt' 
# REPL $ sudo pWrkSpcL_arcArch  "$d_bin"'bash read-eval-print loop/wrkSpc image library.txt'
#




# +--+
# build summary of key points : 
#kp# 
#kp# *********************
#kp# "$d_bin"'image library.sh'
#kp# 
# $ grep  "^#kp#"  "$d_bin"'image library.sh'  |  sed  's|^#kp#|  |'  >"$d_bin"'image library.sh'' TblOfKeyPoints.txt' 
#08********08
# Setup 

source  "$d_bin"'fileops.sh'



#08********08
# code 

#] pImgL_sizX_sizY_scale_dOut				#() re-scale images of pImgL, output to dOut (all same scale)
# 31May2025 initial
# create file pImgL, listing all images to process, before running this

	pImgL_sizX_sizY_scale_dOut()
{
	local pImgL="$1"
	local sizeX="$2"
	local sizeY="$3"
	local d_Out="$4"
	
	local fNam=''
	local pOvr=''

	while read -u 9 pImg; do
		fnmNoExt=$( pth_get_fnmNoExt	"$pImg" )			#() get fname without extension
		filNmExt=$( pth_get_ext			"$pImg" )			#() get extension without fname from pth
		pOvr="$d_Out$fnmNoExt $sizeX"x"$sizeY.$filNmExt"
		convert "$pImg"  -resize  "$sizeX"x"$sizeY"+0+0  "$pOvr"  
	done 9< "$pImgL" 
}


#] pXYImgL_scale_dOut						#() re-scale images of pImgL to different [X,Y], output to dOut
# 01Jun2025 initial
# create file pImgL, listing all images to process with output [X,Y] pixel size, before running this

	pXYImgL_scale_dOut()
{
	local pImgL="$1"
	local d_Out="$2"
	
	local fNam=''
	local pOvr=''

	while IFS=$'\t'  read -u 9  sizeX  sizeY  pImg; do
		fnmNoExt=$( pth_get_fnmNoExt	"$pImg" )			#() get fname without extension
		filNmExt=$( pth_get_ext			"$pImg" )			#() get extension without fname from pth
		pOvr="$d_Out$fnmNoExt $sizeX"x"$sizeY.$filNmExt"
		convert "$pImg"  -resize  "$sizeX"x"$sizeY"+0+0  "$pOvr"  
	done 9< "$pImgL" 
}


#] pTabSepL_printCells						#() test of readibng three columns from file
# 01Jun2025 initial

	pTabSepL_printCells()
{
	local pTabSepL="$1"

	while IFS=$'\t'  read -u 9  sizeX  sizeY  pImg; do
		echo  "col1= $sizeX, col2= $sizeY, col3= $pImg" 
	done 9< "$pTabSepL" 
}





#08********08
# Procedures -  do not run directly!!, run from "$d_bin"'image library run.sh' 






# enddoc
