[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cropping a large collection of .PNG screenshots



On 13/04/14 20:21, Andrei POPESCU wrote:
> On Sb, 12 apr 14, 12:26:48, Steve Litt wrote:
>> On Thu, 10 Apr 2014 00:43:45 +0300
>> Andrei POPESCU <andreimpopescu@gmail.com> wrote:
>>
>>> On Mi, 09 apr 14, 08:59:51, Steve Litt wrote:
>>>>
>>>> Or, you can just redirect ls into a file, use Vim to convert and
>>>> rename each file individually.
>>>
>>> Could you please elaborate on this?
>>
>> ls -1 *.png > doit.sh

for i in `ls *.png`;

>> chmod a+x doit.sh
>> gvim doit.sh
>> :%s/^/doconvert  /
>> ggi
>> function doconvert(){
>>  mv $1 $1.bak

# WxH+X+Y
do convert $i -crop 600x400+0+600 crop_$i;


>>  convert -crop whatever $1.bak $1
>> }<esc>
>> :wq
>> ./doit.sh

done

> 
> (g)vim seems overkill to me.
> 
> Kind regards,
> Andrei
> 

Agreed.

Kind regards


Reply to: