homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
Forum Library, Charter, Moderators: not2easy

Site Graphics and Multimedia Design Forum

Filtering images. Is this a manual job?

 2:00 am on Apr 5, 2009 (gmt 0)

Here's my situation

I have approximately 80,000 jpgs. They are sorted into folders in a variety of sizes: 80x80 (large), 40x40 (medium), 20x20 (small), and 10x10 (icon).

many of them, perhaps a few thousand, are real photos. But probably the majority of them are blank - just a black square. A scan gone bad.

I need to delete all the empty ones - remove any jpg image of a plain black square, leaving only the JPGs that are not plain black squares.

What is the quickest way to do this? Say, if I needed it to be finished by tomorrow morning, and it's 9:52pm now, and I still have to do my laundry. How would you do this?

I looked at the folder sorted by file size. I figured if one of the black squares is 809 bytes, then all the images with exactly 809 bytes will be empty ones. But Windows Explorer, for some unfathomable reason, won't show me the exact byte size of the 10x10 files - they all say 1KB,1KB,1KB,1KB,1KB. Same in XP or Vista, I've checked in both.

This should be a simple job, but I'm discovering that it might actually be a long, arduous chore. Any advice warmly welcomed



 2:14 am on Apr 5, 2009 (gmt 0)

Windows Explorer will round file sizes. Drop to run/cmd.exe yourtopfolder/dir /s *.ext > list.txt. Parse list.txt for < x-bytes then run batch to delete. Old school, works a treat.


 3:13 am on Apr 5, 2009 (gmt 0)

thanks tangor!

I found a more comfortable way. In Vista, I viewed the folder as "medium icons". Waited a few seconds for all the thumbnails to render, then sorted the view by size. Then it was easy to see a large section on continugous blank squares, select those, and delete.

That method also allowed me to do a full-page visual scan to make sure I wasn't deleting any legit images. The task is finished and it only took me 10 minutes. Now... it'll take an hour to upload them all to my server... now off to do my laundry.



 4:19 am on Apr 5, 2009 (gmt 0)

I keep forgetting about windoze xp-ish thumbs.db (turned off on my systems as I do not find it a practical or necessary "perk"). The litter of files that "perk" creates gives me heebie-jeebies (I do miss my DOS 3.11 and clean tight code and ordinary housecleaning). Meanwhile, I do run ThumbsPlus as my image app that gives me the same visual...without littering the drive with thumbs.db files.

That reminds me. I need to do some laundry myself! :)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved