Tuesday, October 28, 2008

I decided to download the Visual Studio 2010 and .NET Framework 4.0 CTP tonight. It comes packaged in a virtual machine (not sure if it is Vista or what yet… I’m going to bed before running it).

And… it is big. Really big.

Pictures are worth a thousand words… in this case, they’re worth just over 30 GB.

image

Wow.

posted on Tuesday, October 28, 2008 9:16:42 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Saturday, October 11, 2008

I was working with a lot of images for a website today and I needed to quickly create thumbnails for each one. I did a quick Google search on PowerShell and creating thumbnails, but I gave up after about a minute… yeah, I probably got impatient, but oh well.

Anyway, here it is:

get-childitem *.jpg | foreach {
    $full = [System.Drawing.Image]::FromFile("$(resolve-path $_)");
    $thumb = $full.GetThumbnailImage(72, 72, $null, [intptr]::Zero);
    $thumb.Save("$(resolve-path $_).thumb.jpg" );
    $full.Dispose();
    $thumb.Dispose();
}

Obviously, you likely wouldn’t hardcode the height and width for the thumbnail, but would probably base it off of the original image (i.e. varying it off of whether the image was wide or tall). But, I didn’t need to. That’s up to you to figure out :-)

posted on Saturday, October 11, 2008 4:21:14 PM (Central Standard Time, UTC-06:00)  #    Comments [4]