Wiedza 4Silas with Love

SiewcaRyżu

Kimchi & Pikachu
Q's Architect
9 Październik 2023
949
3
643
93
23
QNAP
null
Ethernet
null
Bash:
#create blank transpartent background
convert -size 320x480! xc:transparent _background.png
#create smaller file
convert Tajni\ i\ fajni\ \(2019\).jpg -resize 320x480! _file.png
#merge two files into one 
montage _file.png _background.png -tile 2x1 -geometry +0+0 -background none _out.png
 
Dziękuje finalnie skonczylem z tym tak....

Bash:
#!/bin/sh

mkdir -p Output 2>/dev/null 1>/dev/null
TMP_OUTPUT="tmp_file.png"
BG=_background.png

[ -f "${BG}" ] && rm -f "${BG}" 2>/dev/null 1>/dev/null
convert -size 349x480! xc:transparent ${BG}
[ $? = 0 ] && echo Transparent bg created || echo Cannot create transparent background

cd Covers

for f in *; do
    filename=$(basename -- "$f")
    extension="${filename##*.}"
    filename="${filename%.*}"
    [ -f "$TMP_OUTPUT" ] && rm -f "$TMP_OUTPUT" 2>/dev/null 1>/dev/null
    #convert "${f}" -resize 291x480! "../${TMP_OUTPUT}"
    convert "${f}" -resize 291x480! -adaptive-sharpen 1 "../${TMP_OUTPUT}"
    montage "../${TMP_OUTPUT}" "../${BG}" -tile 2x1 -geometry +0+0 -background none "../Output/${filename}.png"
done

cd ..

Wcześniej tylko musiałem dopasować wielkości liter zeby sie zgadzały...
Bash:
#!/bin/sh

MOVIES_PATH="../Converted"

cd Convers_Correct

for f in *; do
  filename=$(basename -- "$f")
  extension="${filename##*.}"
  filename="${filename%.*}"
  #echo $filename
  _movie_filename=$(ls -1 "$MOVIES_PATH" | grep -i "$filename")
  _movie_filename=$(basename -- "$_movie_filename")
  movie_extension="${_movie_filename##*.}"
  movie_filename="${_movie_filename%.*}"
  [ "$filename" == "$movie_filename" ] && continue
  mv -f "$MOVIES_PATH/${_movie_filename}" "$MOVIES_PATH/${filename}.${movie_extension}"
done # | wc -l

cd ..
 
  • Clapping Hands
Reakcje: SiewcaRyżu