Created
          September 17, 2012 19:37 
        
      - 
      
 - 
        
Save akmurray/3739310 to your computer and use it in GitHub Desktop.  
    Snippet from build script to generate thumbnails: https://github.com/akmurray/aaronkmurray-blog-tools/blob/master/build/build-aaronkmurray-site.bat
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | REM Make thumbnails if necessary | |
| FOR /F %%A IN ('dir /b "../../aaronkmurray-blog/img/blog/screenshots/" ^|findstr /liv "thumb"') DO ( | |
| REM "SETLOCAL ENABLEDELAYEDEXPANSION" so that we can update variables inside a loop. Those variables are wrapped in "!" instead of "%" | |
| SETLOCAL ENABLEDELAYEDEXPANSION | |
| REM variables | |
| SET thumbName=%%~nA-thumb-100.png | |
| SET thumbPath=../../aaronkmurray-blog/img/blog/screenshots/ | |
| SET thumbPathAndName=!thumbPath!!thumbName! | |
| IF NOT EXIST !thumbPathAndName! ( | |
| ECHO Creating thumbnail for !thumbName! | |
| convert.exe -thumbnail 100 !thumbPath!%%A !thumbPathAndName! | |
| ) ELSE ( | |
| REM ECHO Already created thumbnail for !thumbName! | |
| ) | |
| ) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment