Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: Paridel
1. There are a lot of image programs with batch modes, and you can throw in other options while you are at it (color correction, etc)

So you buy windows so that you can get other programs to do what you might need. So I have an old album of gifs I want to convert, I have to go out and buy something to do it?

2. You could do it pretty trivially with a batch file.

Because if the Linux command line is too much for a user, they will have no problem writing windows batch scripts (/sarcasm)

3. You could write a little Perl script (with Image::Magick or similar). - My preferred method cause the result works (if you are careful) with Linux & Windows.

Again, this requires you are able to write a perl script, if you can do this you are smart enough to Gnome...

The point of the OP was the the GUI more often than not makes things difficult, faster maybe, shorter learning curve probably, but in the end more of a pain..

123 posted on 11/23/2004 1:06:48 PM PST by N3WBI3
[ Post Reply | Private Reply | To 117 | View Replies ]


To: N3WBI3
So I have an old album of gifs I want to convert, I have to go out and buy something to do it?

No. About 10 seconds of searching popped up the first of I'm sure an almost infinite amount of free GUI based windows batch files converters: Easy Graphic Converter (note, I know nothing about this program, only trying to prove a point)

Because if the Linux command line is too much for a user, they will have no problem writing windows batch scripts (/sarcasm)

My point was that if you want CLI you can do it in Windows as well.

Again, this requires you are able to write a perl script, if you can do this you are smart enough to Gnome...

I have no idea what that means exactly. However Perl is just as easy as scripting in bash or any other command line language. And it is cross platform and free.

Let's just go over this really quick. You used the "convert" program, this is included with the ImageMagick package, available for both Linux and Windows. This is your example script in Linux:

for img in `ls *.jpg`; do convert $img $img-.gif; done

And in windows (might be a little off, I'm rusty on batch files, but close):

for %%f in (*.jpg) do convert %%f %%f-.gif

My goodness, they are almost the same!

Then perl, img_conv.pl:

#!/usr/bin/perl -w
use Image::Magick; use strict;
my $new_suffix = pop(@ARGV);
foreach my $image_file (@ARGV){
my $image = Image::Magick->new();
$image -> Read($_);
$image_file =~ s/\.[^.]+$/.$new_suffix/;
$image->Write($image_file);
}

Except the Perl program takes file.jpg and makes file.gif, not file.jpg-gif, is saved an a file and can be executed at a later date, and can be easily made to do something more complex, like converting all files in subdirectories as well. AND works with linux and windows.

-paridel
134 posted on 11/23/2004 2:01:32 PM PST by Paridel
[ Post Reply | Private Reply | To 123 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson