lunedì 29 settembre 2008

Batch Scan and Crop using Irfanview

Windows Batch Script.
Given a folder it will acquire the image with the scanner and crop it in four different parts

@echo off
rem irfanview folder
set ir_view_path=C:\Programmi\IrfanView
rem filename to modify
set filename=%1%
rem irfanview program file
set ir_view=%ir_view_path%\i_view32.exe
rem half of the width
set width=850
rem half of the height
set height=1170
cd %filename%
"%ir_view%" /scanhidden /convert=image.jpg
"%ir_view%" image.jpg /crop=(0,0,%width%,%height%) /convert=1.jpg
"%ir_view%" image.jpg /crop=(%width%,0,%width%,%height%) /convert=2.jpg
"%ir_view%" image.jpg /crop=(0,%height%,%width%,%height%) /convert=3.jpg
"%ir_view%" image.jpg /crop=(%width%,%height%,%width%,%height%) /convert=4.jpg

Nessun commento: