<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>technical architecture. &#187; Gallery</title>
	<atom:link href="http://buchhofer.com/tag/gallery/feed/" rel="self" type="application/rss+xml" />
	<link>http://buchhofer.com</link>
	<description>Maxscript, Architecture, 3D, 3DSMax, Unity3D</description>
	<lastBuildDate>Mon, 30 Apr 2012 00:46:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Recursive file size listing output to excel</title>
		<link>http://buchhofer.com/2009/12/recursive-file-size-listing-output-to-excel/</link>
		<comments>http://buchhofer.com/2009/12/recursive-file-size-listing-output-to-excel/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 19:18:23 +0000</pubDate>
		<dc:creator>Dave Buchhofer</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Batching]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[asset management]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://buchhofer.com/?p=226</guid>
		<description><![CDATA[Today I had to find all JPG files over a certain size in a large directory tree of a few thousand images, to find some poorly compressed jpg&#8217;s, fix the compression, and replace them on a website. Todays cavaet, the CMS is pretty weak and only lets you update 1 image at a time, so [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to find all JPG files over a certain size in a large directory tree of a few thousand images, to find some poorly compressed jpg&#8217;s, fix the compression, and replace them on a website. Todays cavaet, the CMS is pretty weak and only lets you update 1 image at a time, so you can&#8217;t just blindly resave everything and reupload, todays Second cavaet, I dont have server level access to said website, so all the normal automated ways are out of luck.</p>
<p>joy.</p>
<p>So I found a little <a href="http://www.tek-tips.com/faqs.cfm?fid=6716">snip of code</a> online, and threw a pretty simple hack job together to narrow the scope some. (PS: If you do end up doing any vbscript, I&#8217;d suggest <a href="http://www.vbsedit.com/">VbsEdit </a> for an IDE) </p>
<p>Anyway! the code:</p>
<p>It searches through a directory tree of your choosing<br />
for any file matching the filetype: &#8220;jpg&#8221;<br />
that is above a size threshold: fileSizeThreshold (In this case, 2kb.. so essentially everything)<br />
and outputs it into an excell sheet with full path and size information<br />
so that you can easily Sort, Filter, Delegate, or use as data for further automating!</p>

<div class="wp_syntax"><div class="code"><pre class="vbscript" style="font-family:monospace;">' // **************************************
' //    ComputerHighGuys recursive search
' //     
' //    Date Created: 20 Aug 07
' //	http://www.tek-tips.com/faqs.cfm?fid=6716
' //
' //	Adjusted to a jpg file search and 
' //	added excel output for easy sorting/filtering
' //	
' // **************************************
&nbsp;
' // If we'd like to save the output into an excel sheet
WriteExcel = &quot;True&quot;
&nbsp;
Dim objexcel
excelRow=2
&nbsp;
' // value the filesize needs to exceed to be visible in the output
fileSizeThreshold=2
&nbsp;
If WriteExcel = &quot;True&quot; Then
	' // Create the Excel sheet to drop the information into
	Set objExcel = createobject(&quot;Excel.application&quot;)   
	objexcel.Workbooks.add
	objexcel.Cells(1, 1).Value = &quot;Folder Name&quot;
	objexcel.Cells(1, 2).Value = &quot;Filename&quot;
	objexcel.Cells(1, 3).Value = &quot;Filesize&quot;
	objexcel.Cells(1, 4).Value = &quot;Filesize Unit&quot;
	objexcel.Visible = True
	Wscript.Sleep 300
End If
&nbsp;
' // Directory to search
searchDir = &quot;C:\&quot;
&nbsp;
set objFSO=CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objFolder = objFSO.GetFolder(searchDir)
Set colFiles = objFolder.Files
&nbsp;
' // Launch the function
ScanSubFolders(objFolder)
&nbsp;
' // recursive function that will search through all subfolders for a specified
' // filetype and output some information about the files to an Excel Sheel
Sub scanSubFolders(objFolder)
	' // Grab sub folders    
    Set colFolders = objFolder.SubFolders
&nbsp;
    For Each objSubFolder In colFolders
&nbsp;
    	' // the files to search
        Set colFiles = objSubFolder.Files
        For Each objFile in colFiles
&nbsp;
            ' // the extension of the filetype to search for  
            If lcase(Right(objFile.Name,3)) = &quot;jpg&quot; Then
&nbsp;
                ' // Getting File size in KB
                If round(objFile.Size/1024,1) &gt; fileSizeThreshold Then
&nbsp;
                	' // echo the files to the console
                	WScript.Echo objSubFolder.Path &amp; &quot;  &quot; &amp; objFile.Name &amp; &quot;  &quot; &amp; round(objFile.Size/1024,1)  &amp; &quot;KB&quot;
&nbsp;
					' // write various shit to excel~                    
                    If WriteExcel = &quot;True&quot; then
                        wscript.Echo objSubFolder.Path &amp; &quot;  &quot; &amp; objFile.Name &amp; &quot;  &quot; &amp; round(objFile.Size/1024,1)  &amp; &quot;KB&quot;
                    	objexcel.Cells(excelRow, 1).Value = objSubFolder.Path
    					objexcel.Cells(excelRow, 2).Value = objFile.Name
    					objexcel.Cells(excelRow, 3).Value =  round(objFile.Size/1024,1)
    					objexcel.Cells(excelRow, 4).Value =  &quot;KB&quot; 
    					excelRow=excelRow+1    
                    End If
                End if    
            End If
        Next
        ScanSubFolders(objSubFolder)
    Next
End Sub</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://buchhofer.com/2009/12/recursive-file-size-listing-output-to-excel/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gallery</title>
		<link>http://buchhofer.com/2008/08/gallery/</link>
		<comments>http://buchhofer.com/2008/08/gallery/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 14:18:35 +0000</pubDate>
		<dc:creator>Dave Buchhofer</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Gallery]]></category>

		<guid isPermaLink="false">http://buchhofer.com/?p=12</guid>
		<description><![CDATA[Here&#8217;s the link to my old Gallery, complete with just exported from JAlbum sexiness, until I find a suitable way to integrate some of the newer work with the new site]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.buchhofer.com/portfolio_2008/album/">Here&#8217;s the link to my old Gallery</a>, complete with just exported from <a href="http://jalbum.net/">JAlbum</a> sexiness, until I find a suitable way to integrate some of the newer work with the new site <img src='http://buchhofer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a href="http://www.buchhofer.com/Portfolio_Smaller/"><img class="size-medium wp-image-13 aligncenter" title="Stills Gallery" src="http://buchhofer.com/wp-content/uploads/2008/08/gallery_thumb-300x158.jpg" alt="" width="300" height="158" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://buchhofer.com/2008/08/gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

