mltefive / docs

https://mltefive.github.io/docs/
1 stars 0 forks source link

convert all files #2

Open 7dir opened 5 years ago

7dir commented 5 years ago
find . -maxdepth 1 -type f -exec bash -c 'iconv -f "cp1251" -t "UTF-8" $1 > $1.converted && mv $1.converted $1' -- {} \;
7dir commented 5 years ago
Lines 5:4 = 1,25 4:3 = 1,3 3:2 = 1,5 16:10 = 1,6 5:3 = 1,6 16:9 = 1,7 64:27 = 2,370

https://ru.wikipedia.org/wiki/%D0%A0%D0%B0%D0%B7%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D0%B5_%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0_%D0%BC%D0%BE%D0%BD%D0%B8%D1%82%D0%BE%D1%80%D0%B0

mogrify -path ./results/ -resize 720x480^ -gravity Center -extent 720x480 ./*.jpg

7dir commented 5 years ago
identify -ping -format '%w/%h' photo.jpg
7dir commented 5 years ago
awk "BEGIN {print `identify -ping -format '%w/%h' result.jpg | tr -d "\n"`}" | tr -d "\n"
7dir commented 5 years ago
for i in `ls 800/`; do convert 800/$i -resize 800x800  $i; done
7dir commented 5 years ago

dirs files to json recirsive

tree -J folder
[
    {"type":"directory","name":"Ландшафт","contents":[
      {"type":"directory","name":"Завитинск Спортплощадка","contents":[
        {"type":"file","name":"1 копия.jpg"},
        {"type":"file","name":"2.jpg"},
        {"type":"file","name":"3.jpg"},
        {"type":"file","name":"фотошоп.jpg"}
      ]},
      {"type":"directory","name":"Парк Белогорск","contents":[
        {"type":"file","name":"п1.jpg"},
        {"type":"file","name":"п2.jpg"},
        {"type":"file","name":"п3.jpg"},
        {"type":"file","name":"п4.jpg"},
        {"type":"file","name":"п5.jpg"}
      ]}

    ]}
]
7dir commented 5 years ago
for i in `find ./` ; do identify -ping -format '%w/%h' $i && echo " "; done
7dir commented 5 years ago
convert image001.png -crop 800x600+190+210 i800x600.png
7dir commented 5 years ago
for i in `find ./` ; do convert $i -crop 800x600+185+205 `echo "../"$i`; done
7dir commented 4 years ago
#!/bin/bash                                           
#enter input encoding here                            
FROM_ENCODING="cp1251"                                
#output encoding(UTF-8)                               
TO_ENCODING="utf-8"                                   
#convert                                              
CONVERT=" iconv -f $FROM_ENCODING -t $TO_ENCODING"    
#loop to convert multiple files                       
for  file  in  *; do                                  
     $CONVERT   "$file" -o "${file%}"                 
done                                                  
exit 0                                                
7dir commented 3 years ago

webp to

dwebp 1.webp -o 1.png