optimise-images icon indicating copy to clipboard operation
optimise-images copied to clipboard

skip original image

Open liewcf opened this issue 8 years ago • 1 comments

Sometimes we want to keep the original image without compression. Is it possible? Use an option or Skip files end with "-ori.jpg"?

liewcf avatar Aug 18 '17 04:08 liewcf

It isn't possible right now. I can see where that might be a usage case though I am not sure how I would implement that right now. Something to think about.

Possibly could extent the find command to exclude certain filename tags like you suggested. So to exclude -orig.jpg

instead of

find "$WORKDIR" -maxdepth ${MAXDEPTH}${FIND_IMGAGEOPT} \( -name '*.jpg' -o -name '*.png' -o -name '*.jpeg' \)

do

find "$WORKDIR" -maxdepth ${MAXDEPTH}${FIND_IMGAGEOPT} \( -name "*.jpg" -o -name "*.png" -o -name "*.jpeg" \) -not \( -name "*-orig.jpg" -o -name "*-orig.png"  -o -name "*-orig.jpeg" \) 

and instead of

find "$WORKDIR" -maxdepth ${MAXDEPTH}${FIND_IMGAGEOPT} \( -name "*.jpg" -o -name "*.png" -o -name "*.jpeg" -o -name "*.webp" \) 

do

find "$WORKDIR" -maxdepth ${MAXDEPTH}${FIND_IMGAGEOPT} \( -name "*.jpg" -o -name "*.png" -o -name "*.jpeg" -o -name "*.webp" \) -not \( -name "*-orig.jpg" -o -name "*-orig.png" -o -name "*-orig.jpeg" -o -name "*-orig.webp" \) 

centminmod avatar Aug 18 '17 04:08 centminmod