General Enhancements (#51)
* Fix website not being trashed during reseed. * Fix port flags. * Fix errors about comments by being sneaky. * Add `encfs`. * Leave the audio alone when compressing videos unless explicitly requested. * ffmpeg seems to default to 128k audio, raise it to 192k. * Handle `time` not being installed more gracefully. * Add audio normlization per Cahlen Lee. * Try preventing directories from being renamed. * Add ability to resize videos, similar to process-video in my Termux project's bashrc. * Add an -A parameter similar to compress_image.sh. * Handle uppercase extensions, use TRASH for old compressed copies if it exists, print the FFMPEG command. * Add datestamps around the conversion. * Maxrate has been working well in Termux project, use it on desktop too, but don't worry about 2-pass. * Automatically source Docker environment for using manage.sh if user is root and file exists. * Add android studio. * Add missing pipes. * Stop including Nix, inclue TTT, add git stash to reset.
This commit is contained in:
@ -106,14 +106,23 @@ $search "$location" | sort | while read image; do
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
new_image="${image//.$extension/}.$tag-$date_YYYYMMDD.$extension"
|
||||
|
||||
## Clean Filename ##
|
||||
# Prevent directory from having its name cleaned too.
|
||||
image_dirname="`dirname $new_image`"
|
||||
image_basename="`basename $new_image`"
|
||||
|
||||
# Clean the filename of extra junk so that they can be chronological order.
|
||||
new_image_clean="${new_image//IMG/}"
|
||||
new_image_clean="${image_basename//IMG/}"
|
||||
new_image_clean="${new_image_clean//_/}"
|
||||
new_image_clean="${new_image_clean//-/}"
|
||||
new_image_clean="${new_image_clean// /}"
|
||||
|
||||
# Add directory back to the full path.
|
||||
new_image_clean="$image_dirname/$new_image_clean"
|
||||
|
||||
# Delete the existing shrunk image if we are forcing a new compression.
|
||||
if [[ -n "$force" && (-e "$new_image" || -e $new_image_clean) ]]; then
|
||||
echo -n " FORCE: "
|
||||
@ -131,9 +140,9 @@ $search "$location" | sort | while read image; do
|
||||
new_image="$new_image_clean"
|
||||
fi
|
||||
|
||||
### TBD Instead of this, only alter the file names, and set a dirname var?
|
||||
# Create a new directory if the directory names were altered.
|
||||
mkdir -pv "`dirname "$new_image"`"
|
||||
###### TBD Instead of this, only alter the file names, and set a dirname var?
|
||||
#### Create a new directory if the directory names were altered.
|
||||
###mkdir -pv "`dirname "$new_image"`"
|
||||
|
||||
# This modifies the image to be $size at its longest end, not be a square.
|
||||
$convert_exe "$image" -resize ${size}x${size} "$new_image"
|
||||
|
Reference in New Issue
Block a user