(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version



Automating jpeg conversions

August 2005



A thread at comp.os.linux.mis recently asked how to control the GUI in order to automate the manipulation of some .jpg files with xv. Of course this can be done (see Xmacroplay), but as many posters pointed out, that's simply the wrong tool for the job: ImageMagick is chock-full of command line tools for graphics files.

As an aside, I'll also point out the fault of asking the wrong question. When you are trying to use a flat blade screwdriver to extract a Philips screw, don't ask where you can get the right size flat blade to fit in the Philips slot. In this case, the poster should have asked "How can I batch convert a bunch of image files?" rather than assuming that it had to be done in the graphical tool he was using.

As I and most of the readers here well know, the command line is becoming less popular than ever, and unfortunately that's true in the Linux world as well. There seem to be a lot of Linux folk who live entirely in the gui. The Linux distro's encourage this: I did a Suse install yesterday and had a heck of a time convincing it that I only wanted text mode. In fact, the text mode install seems to even be a little bit broken as it hangs dead at the end. When it reboots to ask the final configuration questions, it again wants and expects to be running a gui and only enters the text based configuration after apologizing for not being able to!

The thread was interesting in another way, too. Someone suggested using Perl with the Image::Magick module , which caused someone else to complain that using a 19 line Perl script to replace a shell one liner was not that great an idea either. The person who suggested the Perl rightfully pointed out that someone wanting to do this sort of thing might want to do more complicated things too, and the Perl script could easily be expanded to do so. He (or she) is absolutely right: shell scripting starts getting clunky pretty quickly. Of course Perl gets clunky at some other point of complexity, but does very, very well in between.

The GUI crowd (some of the GUI crowd) may not understand the value of command line scripting (shell, Perl, or name your poison), but that's simply their failing. GUI's are great for some tasks, and those of us who do appreciate command line scripting know that: we cheerfully use GUI's when it makes sense to do so, and use command line tools when it doesn't. We don't use Lynx for day to day browsing, but we don't generally resort to simulating keystrokes in Windows to get other jobs done. The right tool for the right job.




Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!



 I sell and support
 Kerio Mail server




pavatar.jpg
More:
       - Opinion
       - Shell
       - Linux


Unix/Linux Consultants

Skills Tests

Guest Post Here











My Favorites

Change Congress