Skip to content

Instantly share code, notes, and snippets.

@igorcosta
Created July 15, 2014 23:04
Show Gist options
  • Save igorcosta/008173b435e0309d4773 to your computer and use it in GitHub Desktop.
Save igorcosta/008173b435e0309d4773 to your computer and use it in GitHub Desktop.
Convert Images from your Camera SD card into web size pictures for Windows Users
@echo off
echo To use you need imageMagick, you can find at http://www.imagemagick.org/
Set timefmt=%time%
Set timefmt=%TIMEFMT:~0,2%%TIMEFMT:~3,2%%TIMEFMT:~6,2%
Set timefmt=%TIMEFMT: =0%
Set diretorio=temp
Set /p inicio=Image range from:
Set /p fim=Imagem range to:
Set /p diretorio=Which directory, if you leave empty it will create automatically:
if NOT exist %diretorio% ( Set diretorio=%timefmt% mkdir %diretorio%) else (mkdir %diretorio%)
echo Directory %diretorio% created with success
echo ...
Set /p porcentagem=Resize image in 0-100 in % (don't use %):
FOR /L %%G IN (%inicio%, 1, %fim%)DO (
convert C:\Users\Igor\Pictures\Jardim_Botanico2014\IMG_%%G.jpg -resize %porcentagem%%% -quality 98 C:\Users\Igor\Pictures\Jardim_Botanico2014\%diretorio%\IMG_%%G.jpg
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment