Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

imagemagick autonumber starting from 1

I can do this to batch resize and rename images in a subfolder:

convert '*.jpg' -resize 256 small/image_%02d.jpg

it will create images starting from image_00.jpg

My problem is, due to import rules of an external service, I need incremental number starting from image_01.jpg

Does IM allow this?

Otherwise which is the smartest way to achieve this?

I'd ls and reverse sort then rename adding 1

like image 723
neurino Avatar asked Jun 25 '12 08:06

neurino


1 Answers

I have never tried this but remember reading something about -scene.

convert '*.jpg' -resize 256 -scene 1 small/image_%02d.jpg

-scene value

set scene number.

This option sets the scene number of an image or the first image in an image sequence.

like image 117
Bonzo Avatar answered Oct 18 '22 02:10

Bonzo