Posted By

DaveChild on 09/11/08


Tagged

images thumbnails


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Tyster
thastyle


DOS Generate Thumbnails with NConvert


 / Published in: DOS Batch
 

Crops and resizes, maintaining perspective, with a white background.

  1. REM Copy images to processing directory
  2. xcopy /Y /C /I /E C:\Imagery\ToProcess C:\Imagery\Processing\Originals
  3.  
  4. REM Copy originals to 200 folder ready for processing
  5. xcopy /Y /C /I /E C:\Imagery\Processing\Originals C:\Imagery\Processing\200x200
  6.  
  7. REM Convert 200s
  8. for /R C:\Imagery\Processing\200x200 %%I in (*.jpg) do "C:\Program Files\XnView\nconvert.exe" -npcd 2 -size 256x256+0 -ctype grey -corder inter -out jpeg -sharpen 1 -autocrop 10 255 255 255 -ratio -rtype linear -rflag orient -resize 190 190 -bgcolor 255 255 255 -canvas 200 200 center "%%I"
  9.  
  10. REM All done - copy images to processed directory
  11. xcopy /Y /C /I /E C:\Imagery\Processing\200x200 C:\Imagery\Processed\200x200
  12. xcopy /Y /C /I /E C:\Imagery\Processing\Originals C:\Imagery\Processed\Originals
  13.  
  14. REM Remove image files from system to prevent repeated conversions of the same images
  15. DEL /F /S /Q "C:\Imagery\Processing\200x200"
  16. DEL /F /S /Q "C:\Imagery\Processing\Originals"
  17. DEL /F /S /Q "C:\Imagery\ToProcess"

Report this snippet  

You need to login to post a comment.