From ba7b0667f032b5e5ced39b068492732e3f674b7b Mon Sep 17 00:00:00 2001 From: Brielle Date: Fri, 10 Jan 2020 12:40:33 -0700 Subject: [PATCH] Commit 1.2 version --- .gitignore | 3 +++ Config File.lnk | Bin 0 -> 980 bytes Convert Images.lnk | Bin 0 -> 1078 bytes bin/config.txt | 42 +++++++++++++++++++++++++++++++++++++++++ bin/process-images.sh | 22 +++++++++++++++++++++ bin/run-conversion.cmd | 3 +++ raw/.gitignore | 2 ++ resized/.gitignore | 2 ++ 8 files changed, 74 insertions(+) create mode 100644 .gitignore create mode 100644 Config File.lnk create mode 100644 Convert Images.lnk create mode 100644 bin/config.txt create mode 100644 bin/process-images.sh create mode 100644 bin/run-conversion.cmd create mode 100644 raw/.gitignore create mode 100644 resized/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..31af859 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin/GraphicsMagick-1.3.25-Q8/ +bin/*.exe +bin/*.dll \ No newline at end of file diff --git a/Config File.lnk b/Config File.lnk new file mode 100644 index 0000000000000000000000000000000000000000..f0ab6d5dfa41c335958c0d6bed5872f23af6dc00 GIT binary patch literal 980 zcmah{K}Zx~6#iBv%`9iba9tz^!dMk`mAotjmeVYX<%S&=nS<^yP7}JjZX0+i@D!2+ ziHB$l35p0KI)qRV5`=V0JVX(ZARSE5Ja+4QGrE*6?1S%r?|<*j_ul{B^aJqKl<)+W z+!Oi(R6wQO*!ApB=F}(Oe(k04yFFu9H~DJN5L+8qQGZ1o(Jg4G4`d( zHI5F~t823}3VJV|i(ZJ`q^q0d%dq`U*Q#eE*37K5R?5?B)BVUj9E@WGHY}u(K?)|l z0qA+&P)P5yI6h~5#J19zlxgri z#=qTEk=fwO4^~ppg9u{>r)0o;=XI7p49ve`k&eOGV0fo-aXT7Rp6rwi-+8pT&_sWw zbkIN?Aqtg|xU^p;h9n*%u5c&vS{0hRmmA!a#aYPvPY~4v7fq>s!RA{HTpPp_GwvvaHd*PpR8 z@HMa^`#32HLMV$WMp$?i!r;j;6_-07-@PX?jx{!BwWdwaG2OD&KDF9;Y3{?s^WeAc Zx*z2)%cFPK{V(q0bl~W{-^Jp>@)wIcxkUf~ literal 0 HcmV?d00001 diff --git a/Convert Images.lnk b/Convert Images.lnk new file mode 100644 index 0000000000000000000000000000000000000000..ec24cb018a5bc8ecb1ad1c838d93cce154ec688c GIT binary patch literal 1078 zcmah{TS${(7=C7w7MWWbOp#niEZN*dh!(|c>mP->wIMCoh3PuT5@ zwzmP8nPU^Ka4_s#-u-OJ-)g?MTr+g}*5acBjBk_<+sRGj|Cf#N`OZo@d@;Hw@)`n}vYUhIT8^34Ff&c&j literal 0 HcmV?d00001 diff --git a/bin/config.txt b/bin/config.txt new file mode 100644 index 0000000..49f3e77 --- /dev/null +++ b/bin/config.txt @@ -0,0 +1,42 @@ +#=-=-=-= DON'T MESS WITH THIS SECTION =-=-=-= +# These are locations of where stuff is located on disk. +# Normally, you don't need to change this UNLESS you move the +# directory outside of C:\ +MAINPREFIX="/C/imageproc" + +BINLOC="${MAINPREFIX}/bin" +RAWLOC="${MAINPREFIX}/raw" +RENAMELOC="${MAINPREFIX}/renamed" +RESIZELOC="${MAINPREFIX}/resized" + +# Path prefix. Best not to change this +# unless you know what your doing. +PATH="${BINLOC}:." + +# Program Version +PROG_VERSION="1.2-04052017" + +# Version of graphicsmagick to use +GM_VERSION="GraphicsMagick-1.3.34-Q8" +#=-=-=-= END SECTION =-=-=-= + +# Here is the commonly changed preferences + +# The end resulting image size. Can be specified +# as just the long length (1600x) or as the desired +# max dimensions (1600x1050). +IMG_RESIZE="1600x" + +# Quality setting. Lower number reduces image size +# at the expense of quality. 0 is lowest, 100 highest +# and 75 is the default. +IMG_QUALITY="75" + +# Custom image options, normally this is blank, but we +# can specify things like sharpness masks if we want. +#IMG_OPTIONS="-unsharp 2x0.5+0.7+0" +IMG_OPTIONS="+profile \"*\"" + +# Number to start the name at. Commonly +# set to "1" +STARTNUM="1" \ No newline at end of file diff --git a/bin/process-images.sh b/bin/process-images.sh new file mode 100644 index 0000000..b59b35f --- /dev/null +++ b/bin/process-images.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +. ./config.txt + +echo -e "eBay Image Processor - Version ${PROG_VERSION}\n\n" +echo -n "Please enter current date: " +read CURRDATE +#CURRDATE="030413" + +echo "Beginning rename..." +${BINLOC}/find ${RAWLOC} -iname '*.jpg' |\ + ${BINLOC}/gawk -v resizeloc=${RESIZELOC} -v currdate=${CURRDATE} -v startnum=${STARTNUM} -v binloc=${BINLOC} 'BEGIN{ a=startnum }{ printf "%s/cp -f \"%s\" \"%s/%s_%04d.jpg\"\n", binloc,$0,resizeloc,currdate,a++ }' \ + | ${BINLOC}/bash + +#echo "Copying..." +#${BINLOC}/cp -f ${RENAMELOC}/* ${RESIZELOC}/ +echo "Resizing..." +time ${BINLOC}/${GM_VERSION}/gm mogrify -resize ${IMG_RESIZE} -quality ${IMG_QUALITY} ${IMG_OPTIONS} ${RESIZELOC}/*.jpg + +echo "Done!" +echo "Press enter to close." +read DUMMYVAR \ No newline at end of file diff --git a/bin/run-conversion.cmd b/bin/run-conversion.cmd new file mode 100644 index 0000000..7c996ba --- /dev/null +++ b/bin/run-conversion.cmd @@ -0,0 +1,3 @@ +@ECHO OFF +set PATH=C:\imageproc\bin;%PATH%;%CD% +bash.exe process-images.sh \ No newline at end of file diff --git a/raw/.gitignore b/raw/.gitignore new file mode 100644 index 0000000..57c01ad --- /dev/null +++ b/raw/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/resized/.gitignore b/resized/.gitignore new file mode 100644 index 0000000..57c01ad --- /dev/null +++ b/resized/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file