So, Amanda had some 400 photographs that needed to be viewed, selected from (maybe a several dozen selected), then each chosen photo converted to jpeg format, resized to 100o pixels wide and saved.

She began the process on her Windoze laptop. The first photograph took about a minute or two. Realizing that the conversion of the photo had to happen before she could decide whether to use that image or not, I quickly calculated that she had about an hour of work in front of her.

The photos happen to be on a flash card. So, I intervened.

“Let me have those photos for a minute.”

“What are you going to do with them?”

“Watch ….”

Flash card plugged into Linux server.

Photos copied into folder inside a Samba share linked to Amanda’s laptop

Bash shell window open.

Tappity tap tap tappity tap… a simple one liner … Enter.

“This is going to take about 20 minutes. Let’s go get ice cream.”

“Ice cream!!!”

So we went and got ice cream and came back and the images were all converted and resized. Now it would only be a matter of deleting the photos she did not want.

So, I’m eating my ice cream and Amanda says, “Well, that was easy. Can we do this to this other group of 600 photos?”

No problem. We have lots of ice cream.

Any guesses as to what the one liner looked like?

Comments

  1. #1 John Swindle
    June 18, 2009

    I’ve never needed to do that particular task, so I have not a single clue. I suppose I could do it with any of several gui-based utilities, and be happy with the results. But. Imagining doing all that with a one-liner gives me a little shiver.

  2. #2 Phil Weadick
    June 18, 2009

    I’d certainly like to know. Might come in handy someday soon.

  3. #3 Courtney
    June 18, 2009

    mogrify -resize 1000×1000 *.jpg

  4. #4 Brad Pitcher
    June 18, 2009

    Was it something like this?

    for image in /media/disk/*; do convert ${image} -resize 1000×1000 ${image}.jpeg ; done

  5. #5 Kyle Jessup
    June 18, 2009

    They have ImageMagick for Windows too. I guess your particular distro came with it installed. (Window sucks, I’m not arguing – just sayin…)

  6. #6 John Moeller
    June 18, 2009

    For image processing, it’s not the OS, it’s the tools. I just ran a batch resize on a few hundred images on a Windows machine that finished in a few minutes (with compression).

    But it’s much, much easier to find and install a command-line-enabled utility that will do it on Linux (which is extremely useful for batch runs), and it’s much more likely to be optimized for current architecture.

    (And come on, a laptop? No need to stack the deck. :-p)

  7. #7 toomanytribbles
    June 18, 2009

    download irfanview. it does batch resizing.

    it’s fast and free.

  8. #8 badrescher
    June 18, 2009

    I completely agree with the comments here – it’s not the OS.

    I do batch runs within PaintShop Pro all the time, on my laptop, and it doesn’t take all that long. Resizing & converting 400 images would probably take less than 5 minutes.

    My husband makes “this is why Mac is better comments” all the time, but it’s almost always something that he thinks is Mac-exclusive, but isn’t.

  9. #9 Raiko
    June 18, 2009

    I guess on a Windoze you’d need a either proper graphic program like Adobe Photoshop (simple macro) or even only Ulead PhotoImpact (stacks) or even something as simple as Gimp and IrfanView for free. At least for IrfanView I am sure it does automated batch-resizing.

    Neither of these options takes too long. I think the humongeous time difference between Amanda’s Windoze and your Linux would decrease significantly with someone more familiar with the program jungle out there. Not like I could blame Amanda, though. The cyberworld is littered with software.

  10. #10 Dunc
    June 18, 2009

    A “minute or two” to resize and resave as JPG? What’s her laptop, a 386? Had she ever seen the software in question before? Even to do it manually it’s only a question of opening the file, then hitting Alt-I, V, 1000, , Alt-F, A, [I can't remember the keyboard shortcut to select the format, probably a could of TABs followed by J], . Unless you’re talking about massive TIFFs or something, it’s a matter of ten seconds, tops.

  11. #11 Dunc
    June 18, 2009

    OK, there’s a couple of [Enter] strokes missing in that sequence. Damned angle brackets…

  12. #12 Michael Spencer
    June 18, 2009

    OK, Linux nerds! Enough already! And wipe that linux-y smirk off your face, Greg :-) You linux people with your tees and your penguin and god knows what elseā€¦

    I suppose that as a OSX user I am a ‘sort’ of FreeBSD user, and I have to tell you that although I will dip into the command line, I just don’t have a problem with a GUI. And a nice GUI, too. The thing about the command line is that it’s dangerous territory for these fat fingers. Bien?

    As to the photos, there are many ways to do what Amanda wanted on my platform of choice, including the excellent GraphicConverter. And Aperture. And iPhoto. Oh. and Gimp. And all in about the same time, probably much less. [note to Amanda: So. How's living with a linux evangelista? kinda fun, I am betting?]

    And based on the other comments, the task is trivial in Windows, too, so looks like A needs more help. Sorry, Greg, coolness factor on this is about a 2 :-)

    [now, where do I get that free Linux Kool-aide? :-)]

  13. #13 Jason Thibeault
    June 18, 2009

    I’m not sure why the photo had to be converted before the selection process had to happen, but yeah, I’d have used convert from the ImageMagick tools, like Brad Pitcher. Only I’d have pointed it at the Samba folder you said you copied them to, and I would have set an output folder so if things didn’t work right I could delete the output folder and try again with either a different tool or different parameters.

  14. #14 george.w
    June 18, 2009

    Photoshop is really the wrong tool for batch work. In Windows I use XnView – you can stack up operations and let ‘er rip.

  15. #15 revere
    June 18, 2009

    and nobody has seen the obvious?

    doing anything like that on a flash drive will take 5x to 10x longer regardless of os choice.
    what speeded up the whole process was taking the files OFF flash and putting them on a harddrive.

    you fail at windoze bashing

    linux>windows>mac>abacus>you

  16. #16 Jason Thibeault
    June 18, 2009

    Revere, you missed that she was manually opening then manually resizing each picture. We’re not talking about the relative speed of batch conversions on different OSs. We’re talking about how a one-line batch conversion beats a manual conversion hands-down.

    We’re also talking about how it’s possible, with a plain vanilla Linux distro with likely nothing special installed, to batch-convert hundreds of images according to a specific set of criteria then walk off and have ice cream instead of spending an hour with Photoshop.

    While, granted, I’m sure a macro could be built to enter in a bunch of keystrokes in Photoshop automatically, and that would certainly be slower than the command line (not just because of the Flash card component, but also from having to display the image and all the GUI components), that also wasn’t the issue at hand.

    So, uh, shut up?

  17. #17 Greg Laden
    June 18, 2009

    The photos had already been moved to the hard drive of the managed Windoze laptop.

    The reason that most reasonable solutions on the Windoze computer would not work is because it was a managed laptop managed by an IT department that probably didn’t even know about these options, and the PhotoShop version was one of those stripped down vesions and nobody knew how to use it.

    The real reason that there was not a “batch” option is because the entire Windows paradigm and the entire Linux paradigm are fundementally different. a Windows user using a Windows computer is going to look for a place to click and all of the support and management associated with the hardwar and software is going to assume that the user is going to look for a place to click and be ill prepared for any other activity.

    In contrast, the Linux user is going to look for a command line utility to do the job, and the entire support system is going to be there to help make that happen.

    This does not mean that Windows computer users do not have sensible command line options. They do. they are just undeveloped, rarely used, and the overall system from the software to support and management options is lacking.

    This does not mean that Linux users do not have GUI options. They do. And they work pretty well.

  18. #18 Greg Laden
    June 18, 2009

    Coutrney and Brad, you are on the right track and that would more or less workd (Brad: You just specify the horizontal size, that was the only requirement).

    Courtney’s solution changes all the files in place, which in this case is better because they are all copies and the intention was to change them.

    However, these were all NEF files and there are better tools to deal with NEF than Imagemagick, which also do conversions.

    I used:

    ufraw-batch –wb=camera –out-type=jpeg –size=1000 *

  19. #19 greg laden
    June 18, 2009

    badresher: I don’t know about the current Paint Shop Pro, but I used to use that program all the time when it was free and better than photoshop (more stable, same features, smaller, faster). Over time it became a for-cost but still dirt cheap option for Windows and was still good. Then I switched what I was doing such that I had access to a Mac with proprietary software and I started using GIMP on the Windows PC. Then I left for Linux. I’m a little surprised there is not a PSP for Linux.

    Raiko: The time difference of importance here is, of course, the mousy solution vs. the ice cream solution. The mousy solution: My wife and I sit at opposite ends of the couch each working on our laptops. The batch solution (the “ice cream” solution): My wife and I throw out a few command line options and go to the grocery store, count the mullets for fun, and pick up some ice cream and hang out watching Rachel Maddow and chowing down.

    Dunc: the raw file is 15 megs, compressed NEF is 5 megs. I think the bottle neck was converting the NEF into something PS could use.

    Michael: No fair. This is not about the X. Anyway, GIMP users use ufraw-batch.

    Jason: I’m not sure why the photo had to be converted before the selection process had to happen I think PS wanted to convert NEF to something else.

  20. #20 Greg Laden
    June 18, 2009

    Jason[16]: exactly.

  21. #21 Dunc
    June 18, 2009

    The real reason that there was not a “batch” option is because the entire Windows paradigm and the entire Linux paradigm are fundementally different. a Windows user using a Windows computer is going to look for a place to click and all of the support and management associated with the hardwar and software is going to assume that the user is going to look for a place to click and be ill prepared for any other activity.

    Twaddle. Loads of Windows programs have command-line interfaces. Once again, you’re blaming the shortcomings of one specific piece of shonky 3rd-party software on the OS, or rather, on the entire GUI paradigm.

  22. #22 greg laden
    June 18, 2009

    Dunc: I’ll let the Adobe Symps chew you up for dissing their product as Shonky and Third Party (Green? Libertarian?)

  23. #23 Dunc
    June 18, 2009

    GIMP FTW! :)

  24. #24 Andrew
    June 18, 2009

    If the entire GUI paradigm is what keeps us from getting our finger gooey with ice cream, than I say “wash your hands of the GUI paradigm!!!”

  25. #25 Andrew
    June 18, 2009

    If the entire GUI paradigm is what keeps us from getting our finger gooey with ice cream, than I say “wash your hands of the GUI paradigm!!!”

  26. #26 Spiv
    June 18, 2009

    Irfanview++. There’s not really even a need to copy the initial files off the flash drive with that, just output to a local drive. Plus you get a nice interface to select all your options, image quality settings, sampling methods etc, instead of having to hunt through man pages to discover them all.

    Granted it’s not part of the shipped microsoft load, because it’s not a microsoft product, and of course microsoft distributions are not open source allowing people to assemble packages. Which isn’t to say it isn’t part of /my/ standard load, along with many other fantastic free tools.

    Basically, I think the problem was not windows: it was lack of knowledge. Which I suspect was the very same lack of knowledge said person had of linux command line operations in general.

    I still do all my batch renames from windows and dos command lines. Not because there aren’t tools to do it in windows, but because I’m an old codger who has been beating up computers for far too long to bother with your new fangled mouse clicking/pushing. I suspect Greg is a similar grump.

    So far what I’ve learned from Greg about Linux is that it is intended to be as unapproachable as possible so that only elite, determined, and bored persons can get into it. That way only the crem get to be Linux users, leaving no need for user support in a world of admin class users. I know this to be hyperbole.

  27. #27 Greg Laden
    June 18, 2009

    Basically, I think the problem was not windows: it was lack of knowledge.

    As I have pointed out above, it is lack of knowledge. It is lack of knowledge in the area of managed windows systems and windows security that disallow the installation of the best software for the job, of the same institutionalized ignorance that does not even produce the second best software for the job,the lack of knowledge of command line approaches that permeates the entire Windows World .. see my comments elsehwere on the elusive Mac Three Button Mouse …

    So far what I’ve learned from Greg about Linux is that it is intended to be as unapproachable as possible so that only elite, determined, and bored persons can get into it. That way only the crem get to be Linux users, leaving no need for user support in a world of admin class users. I know this to be hyperbole.

    There was a time when that would not have been hyperbole at all; Even just a few years ago it was very common that if ‘noob’ asked a basic question on a Linux forum the ‘experts’ would spend far more time chastizing the noob than simply answering the question.

    Also, as I have been saying all along, and here we are agreeing, the difference is not the software, or the OS, as much as it is the culture.

    But then, the culture determines how the OS is maintained, the operational models of the software, and the standing actual (as in it actually matters) implementation in real life (see three button mac mouse, again).

    However, it is also true that the Linux world has done a virtual 180 on this over the last two years.

  28. #28 Ben Zvan
    June 18, 2009

    Hey Greg, I have one of those Mac 3-button mice.

    Photoshop isn’t really the tool for converting RAW files, but it does have a very robust batch-processing function (File:Automate:Batch…) that could probably be set up for RAW files. The trick would be to get it to override the RAW import dialogue. The functionality of Photoshop between Mac OS and Windows is effectively identical.

    Lightroom would be a better choice and it would be a two-step process, one to import and one to export. You’d also be able to preview and choose photos before doing the export. For importing, the limiting factor is the speed of the source media. I just ran a quick test with 419 12MPx Canon RAW images exporting to fit-to-1000px in .jpg format. It ran 13 minutes but included some exposure and color corrections as part of the export.

  29. #29 Greg Laden
    June 18, 2009

    Hey Greg, I have one of those Mac 3-button mice.

    I know but you are also RHL certified and I’ve seen you issue bash commands on your sony TV using your play station as in interface between your BSD based laptop and one of the servers in your basement which I think was controlling the main data storage units at a major research institution, so you definitely do not count.

    419 12MPx Canon RAW images exporting to fit-to-1000px in .jpg format. It ran 13 minutes but included some exposure and color corrections as part of the export.

    I had almost exactly the same result, which also turns out to be the amount of time it takes to go to the Cub up the street, buy some ice cream, bring it back, serve it up and just start eating it.

    I wonder if Google conversion knows about this particular conversation.

  30. #30 Mike V
    June 18, 2009

    If she wants to be able to do it from inside Windows, then there’s a PowerToy for that called Image Resizer. You can select a bunch of image files, right click and select ‘resize’, and it gives you a list of common sizes, as well as a custom size option.

    Of course, if it’s an IT-managed system that may not be an option. At my last job, the IT department tried to control what we had installed on our Linux laptops, and we were all OS and system developers. They weren’t particularly successful. :)

  31. #31 Ben Zvan
    June 18, 2009

    I wonder if Google conversion knows about this particular conversation.

    Export 400 jpg at 1000px on long side = One dish of ice cream
    Boot Windows = 1 delivery pizza

Current ye@r *