N
N
Nikita Nafranets2016-03-05 18:26:45
bash
Nikita Nafranets, 2016-03-05 18:26:45

How to automate routine actions?

I fill the content for the site and do the same actions when I want to add pictures. Namely, I rename everyone under one mask, then through Photoshop (file-script-image processor) I change the size of all pictures to 300x300, and then I put the ending _m on these 300x300 pictures, after that I take all the pictures and run them through the WatermarkForHameleon program to put them on on all watermark, and then upload to ftp. Actions I repeat every day dohrena times. Is it possible to implement all this through some thread cmd script? As I understand it, I just need to change photoshop and watermak to something else.
UPDATE:
Looking for answers to my questions, I found an example with the simplest loop that I actively used. And I got this script

#!/bin/bash
mkdir jpg_s;
mkdir watermark;
for file in *.jpg
do 
  convert $file -resize 300x300 jpg_s/"`basename $file .jpg`_s.jpg"
done;
for file in jpg_s/*.jpg
do 
  composite -dissolve 70% -gravity center -quality 100 \( d:/watermarks/water-logo.png -resize 18.5% \) $file watermark/"`basename $file .jpg`.jpg"
done;
for file in *.jpg
do 
  composite -dissolve 70% -gravity center -quality 100 \( d:/watermarks/water-logo.png -resize 50% \) $file watermark/"`basename $file .jpg`.jpg"
done;

It does almost everything I wanted. In addition to 2 things, it does not select a file in the root of a folder that does not have an ending - (n) and does not upload to ftp.
I found a guide on how to make an ftp connection, but then everything collapsed for me. ftp.exe in windows does not work correctly in bash
b1b1f9e3c4324dbfbb5e8cc83dd399e9.png
How to solve these problems?
UPDATE 2:
I solved the problem with ftp via curl, although it takes quite a long time to download in my opinion, but it works very simply, which is good.
UPDATE 3: I solved the problem with the automatic calculation of the watermark size.
The main question is how do I select a file without ending?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikita Nafranets, 2016-03-06
@Dimensi

Solved all problems. Thank you all for your attention.

V
Vladimir Martyanov, 2016-03-05
@vilgeforce

Look at ImageMagick.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question