batch convert all PNG files on disk to correct PNG thumbnail bug

S

spoon2001

I want to load and resave all PNG files on my disk to the same location and
file name. Can anybody advise me how to accomplish this using freeware?

Reason: many of my PNG files were created using an earlier version of
Irfanview, and there was some sort of bug causing thumbnails and viewers to
display the PNG images incorrectly - it looks like a scrambled TV signal.
The problem is fixed if the PNG files are loaded and resaved using a newer
version of Irfanview.

Just tried to accomplish this using the batch convert functions of Irfanview
and Xnview. Both programs choked - "not responding".

Have downloaded ImageMagick, also have Nconvert utility that comes with
Xnview ... but the syntax is very detailed and complex.
 
N

nobody

spoon2001 said:
I want to load and resave all PNG files on my disk to the same location and
file name. Can anybody advise me how to accomplish this using freeware?

Reason: many of my PNG files were created using an earlier version of
Irfanview, and there was some sort of bug causing thumbnails and viewers to
display the PNG images incorrectly - it looks like a scrambled TV signal.
The problem is fixed if the PNG files are loaded and resaved using a newer
version of Irfanview.

Just tried to accomplish this using the batch convert functions of Irfanview
and Xnview. Both programs choked - "not responding".

Try with Irfanview again but only load a "reasonable" amount of
files at a time. This should work although it will take a little
longer.
 
S

spoon2001

nobody said:
Try with Irfanview again but only load a "reasonable" amount of
files at a time. This should work although it will take a little
longer.

Nope, that doesn't do the job ... even though Irfanview will recurse the
directory tree for input files - e.g.

c:\data\pics\
c:\data\pics\level1
c:\data\pics\level1\level2

.... it won't put output files in the same locations as the input files ...
it wants to put all of the output files into a single directory ... e.g.

c:\data\pics

That spells disaster!

Luckily I was watching and clicked the STOP button before too much damage
was done.

Arrgh.

I used to have a little DOS utility that would recurse the directory tree
and run the same command-line on each directory in the tree. That would
work here, I think, together with an Irfanview /convert command-line option.
 
B

B. R. 'BeAr' Ederson

Try with Irfanview again but only load a "reasonable" amount of
files at a time. This should work although it will take a little
longer.

Nope, that doesn't do the job ... even though Irfanview will recurse the
directory tree for input files - e.g. [...]
... it won't put output files in the same locations as the input files ...
it wants to put all of the output files into a single directory ... e.g.

You could run:

i_view32.exe sample.png /convert=sample.png

I have no defect *.png files to test. But if I try it on *.jpg the file
size changes. (Using my default setting of compression quality, if I'm
not mistaken.) So it might rewrite *.png files, too.

If the above succeeds, you can run a command like this (if you're on
Win2k or WinXP):

cmd /c for /R D:\Picts %i in (*.png) do C:\IView\i_view32 %i /convert=%i

The above assumes IrfanView is inside the C:\IView folder and the *.png
files can be found within the D:\Picts folder (and its subfolders). It
should rewrite any *.png file found. Don't use too deeply nested folders.
Else you'll encounter problems with the command line buffer size.
I used to have a little DOS utility that would recurse the directory tree
and run the same command-line on each directory in the tree. That would
work here, I think, together with an Irfanview /convert command-line option.

Maybe <Locate> by Charles Dye:

http://www.highfiber.com/~raster/freeware.htm

BeAr
 
S

spoon2001

B. R. 'BeAr' Ederson said:
You could run:

i_view32.exe sample.png /convert=sample.png

I have no defect *.png files to test. But if I try it on *.jpg the
file
size changes. (Using my default setting of compression quality, if I'm
not mistaken.) So it might rewrite *.png files, too.

If the above succeeds, you can run a command like this (if you're on
Win2k or WinXP):

cmd /c for /R D:\Picts %i in (*.png) do C:\IView\i_view32 %i
/convert=%i

The above assumes IrfanView is inside the C:\IView folder and the
*.png files can be found within the D:\Picts folder (and its
subfolders). It should rewrite any *.png file found. Don't use too
deeply nested folders. Else you'll encounter problems with the
command line buffer size.


Maybe <Locate> by Charles Dye:

http://www.highfiber.com/~raster/freeware.htm

BeAr

Hi BeAr,

Worked like a charm. Thanks!

I never knew about the /R switch on the FOR command. We didn't have that in
the DOS version of FOR. Somewhere online there ought to be a complete
reference for all the XP internal/external commands, listing all the
switches, etc. with examples. I haven't found it yet.
 
B

B. R. 'BeAr' Ederson

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top