Sign in with
Sign up | Sign in
Your question

Replace tiff images to jpeg

Last response: in Digital Camera
Share
Anonymous
February 18, 2005 5:31:35 AM

Archived from groups: rec.photo.digital (More info?)

Hi everyone,

Is there a program the that can replace all my tiff files which are in
different directories to jpegs in the same directories.

eg.

i have several folders with tiff images. What i would like is select
all those folders and then tell it to convert all images (tiff) to
jpeg Images and copy back to those folders. Is there application out
there somewhere for this?

I don't want to goto each individual folder and convert the images to
jpeg. I have paintshop pro 8 but don't think it can do this.

cheers

Farouq
Anonymous
February 18, 2005 1:58:30 PM

Archived from groups: rec.photo.digital (More info?)

Farouq wrote:
> Hi everyone,
>
> Is there a program the that can replace all my tiff files which are in
> different directories to jpegs in the same directories.
>
> eg.
>
> i have several folders with tiff images. What i would like is select
> all those folders and then tell it to convert all images (tiff) to
> jpeg Images and copy back to those folders. Is there application out
> there somewhere for this?
>
> I don't want to goto each individual folder and convert the images to
> jpeg. I have paintshop pro 8 but don't think it can do this.
>
> cheers
>
> Farouq

Paint Shop Pro does have a batch conversion tool, but you could also use
IrfanView driven from the command-line:

FOR %%I IN (*.tiff) DO (
IF NOT EXIST %%~nI.jpg (
C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.jpg
)
)

(Windows 2000 command example, you would need to wrap this is code to
visit all the folders to be converted).

Cheers,
David
Anonymous
February 18, 2005 11:50:12 PM

Archived from groups: rec.photo.digital (More info?)

David J Taylor wrote:
> Farouq wrote:
>
>>Hi everyone,
>>
>>Is there a program the that can replace all my tiff files which are in
>>different directories to jpegs in the same directories.
>>
>>eg.
>>
>>i have several folders with tiff images. What i would like is select
>>all those folders and then tell it to convert all images (tiff) to
>>jpeg Images and copy back to those folders. Is there application out
>>there somewhere for this?
>>
>>I don't want to goto each individual folder and convert the images to
>>jpeg. I have paintshop pro 8 but don't think it can do this.
>>
>>cheers
>>
>>Farouq
>
>
> Paint Shop Pro does have a batch conversion tool, but you could also use
> IrfanView driven from the command-line:
>
> FOR %%I IN (*.tiff) DO (
> IF NOT EXIST %%~nI.jpg (
> C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.jpg
> )
> )
>
> (Windows 2000 command example, you would need to wrap this is code to
> visit all the folders to be converted).
>
> Cheers,
> David
>
>
IrfanView has batch conversion (accessable from the file menu)

Tony M
Related resources
Anonymous
February 19, 2005 12:32:05 PM

Archived from groups: rec.photo.digital (More info?)

Tony M wrote:
[]
>> Paint Shop Pro does have a batch conversion tool, but you could also
>> use IrfanView driven from the command-line:
>>
>> FOR %%I IN (*.tiff) DO (
>> IF NOT EXIST %%~nI.jpg (
>> C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.jpg
>> )
>> )
>>
>> (Windows 2000 command example, you would need to wrap this is code to
>> visit all the folders to be converted).
>>
>> Cheers,
>> David
>>
>>
> IrfanView has batch conversion (accessable from the file menu)
>
> Tony M

Thanks, Tony, but in my case I wanted something that ran automatically
every night. That's why I went the batch command file route.

Cheers,
David
February 19, 2005 3:39:57 PM

Archived from groups: rec.photo.digital (More info?)

David J Taylor wrote:

> ...you could also use
> IrfanView driven from the command-line:
>
> FOR %%I IN (*.tiff) DO (
> IF NOT EXIST %%~nI.jpg (
> C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.jpg
> )
> )
>
> (Windows 2000 command example, you would need to wrap this is code to
> visit all the folders to be converted).


Do you run something like that in a .bat file? I didn't know irfanview
could run from command line.

I'm thinking of a bat file I could copy into a folder, click once & make
the folder's contents into web size plus thumbnails but maybe it's not
that easy.
Anonymous
February 20, 2005 1:24:23 AM

Archived from groups: rec.photo.digital (More info?)

paul wrote:
> David J Taylor wrote:
>
>> ...you could also use
>> IrfanView driven from the command-line:
>>
>> FOR %%I IN (*.tiff) DO (
>> IF NOT EXIST %%~nI.jpg (
>> C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.jpg
>> )
>> )
>>
>> (Windows 2000 command example, you would need to wrap this is code to
>> visit all the folders to be converted).
>
>
> Do you run something like that in a .bat file? I didn't know irfanview
> could run from command line.
>
> I'm thinking of a bat file I could copy into a folder, click once &
> make the folder's contents into web size plus thumbnails but maybe
> it's not that easy.

Yes, IrfanView works nicely in batch. I used to run an overnight
conversion of automatically gathered TIFF files into PNG format using
something very similar to the above. It halved the file size as the TIFF
were not compressed. I no longer need to do this as I stopped collecting
the TIFF data.

In IrfanView, try Help, Index, Command-line options for a very useful
summary.

Cheers,
David
February 20, 2005 1:24:24 AM

Archived from groups: rec.photo.digital (More info?)

David J Taylor wrote:
> paul wrote:
>
>>David J Taylor wrote:
>>
>>
>>>...you could also use
>>>IrfanView driven from the command-line:
>>>
>>>FOR %%I IN (*.tiff) DO (
>>> IF NOT EXIST %%~nI.jpg (
>>> C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.jpg
>>> )
>>>)
>>>
>>>(Windows 2000 command example, you would need to wrap this is code to
>>>visit all the folders to be converted).
>>
>>
>>Do you run something like that in a .bat file? I didn't know irfanview
>>could run from command line.
>>
>>I'm thinking of a bat file I could copy into a folder, click once &
>>make the folder's contents into web size plus thumbnails but maybe
>>it's not that easy.
>
>
> Yes, IrfanView works nicely in batch. I used to run an overnight
> conversion of automatically gathered TIFF files into PNG format using
> something very similar to the above. It halved the file size as the TIFF
> were not compressed. I no longer need to do this as I stopped collecting
> the TIFF data.
>
> In IrfanView, try Help, Index, Command-line options for a very useful
> summary.


I found that but nothing about your loop syntax. I have some coding
experience but no clue what sort of scripting would work in a .bat file
to process all files in the folder the bat is launched from.

I tried your code above & it just blinks. All I've done with batch files is
dir *.* > dir.txt
<grin>

The results would need to go in a standard subfolder names "/web"
"/web/thumbs", I guess you ~n adds a number to the name?
Anonymous
February 20, 2005 1:48:35 PM

Archived from groups: rec.photo.digital (More info?)

paul wrote:
[]
> I found that but nothing about your loop syntax. I have some coding
> experience but no clue what sort of scripting would work in a .bat
> file to process all files in the folder the bat is launched from.
>
> I tried your code above & it just blinks. All I've done with batch
> files is dir *.* > dir.txt
> <grin>
>
> The results would need to go in a standard subfolder names "/web"
> "/web/thumbs", I guess you ~n adds a number to the name?

As I said, this was from a Windows 2000 system - Windows NT/2000/XP
extended the DOS command syntax quite extensively - type HELP FOR at a
command prompt for more information. Obviously you would need to edit the
code I supplied to suit where you had installed IrfanView, for example.
The original batch file I used also included the code as a subroutine so
that it could be called more than once. Bet you didn't know you could
have subroutines in DOS command files either! In the subroutine, %%I will
contain all the TIFF files, one at a time. If the matching .PNG file
doesn't exist, IrfanView is called to convert the TIFF to PNG format. In
the second step, for all the .PNG files, if the matching .TIFF file is
more than four days old it is deleted. GetFileAge is a program I wrote
myself.

---------------------------------------------------

PUSHD C:\folder-1\
REM CALL :D o_ALL
POPD


PUSHD C:\folder-2\
REM CALL :D o_ALL
POPD

EXIT

:D o_ALL

FOR %%I IN (*.tiff) DO (
IF NOT EXIST %%~nI.png (
C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.png
)
)

FOR %%I IN (*.png) DO (
GetFileAge %%~nI.tiff
IF ERRORLEVEL 4 DEL %%~nI.tiff
)

GOTO :EOF
---------------------------------------------------

Cheers,
David
February 20, 2005 1:48:36 PM

Archived from groups: rec.photo.digital (More info?)

OK well thanks for some hints. Too many questions & having a tough time
finding a good tutorial on this. I do have XP & was looking at something
like:

FORFILES -m*.tif -v
-cC:\Program Files\IrfanView\i_view32.exe *.tif /convert=*.jpg
>report.txt

Anyways it does nothing, even the report is empty. I can't even see what
it's doing with -v verbose. Ack. If anyone knows a good resource...



David J Taylor wrote:
> paul wrote:
> []
>
>>I found that but nothing about your loop syntax. I have some coding
>>experience but no clue what sort of scripting would work in a .bat
>>file to process all files in the folder the bat is launched from.
>>
>>I tried your code above & it just blinks. All I've done with batch
>>files is dir *.* > dir.txt
>><grin>
>>
>>The results would need to go in a standard subfolder names "/web"
>>"/web/thumbs", I guess you ~n adds a number to the name?
>
>
> As I said, this was from a Windows 2000 system - Windows NT/2000/XP
> extended the DOS command syntax quite extensively - type HELP FOR at a
> command prompt for more information. Obviously you would need to edit the
> code I supplied to suit where you had installed IrfanView, for example.
> The original batch file I used also included the code as a subroutine so
> that it could be called more than once. Bet you didn't know you could
> have subroutines in DOS command files either! In the subroutine, %%I will
> contain all the TIFF files, one at a time. If the matching .PNG file
> doesn't exist, IrfanView is called to convert the TIFF to PNG format. In
> the second step, for all the .PNG files, if the matching .TIFF file is
> more than four days old it is deleted. GetFileAge is a program I wrote
> myself.
>
> ---------------------------------------------------
>
> PUSHD C:\folder-1\
> REM CALL :D o_ALL
> POPD
>
>
> PUSHD C:\folder-2\
> REM CALL :D o_ALL
> POPD
>
> EXIT
>
> :D o_ALL
>
> FOR %%I IN (*.tiff) DO (
> IF NOT EXIST %%~nI.png (
> C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.png
> )
> )
>
> FOR %%I IN (*.png) DO (
> GetFileAge %%~nI.tiff
> IF ERRORLEVEL 4 DEL %%~nI.tiff
> )
>
> GOTO :EOF
> ---------------------------------------------------
>
> Cheers,
> David
>
>
Anonymous
February 20, 2005 7:51:50 PM

Archived from groups: rec.photo.digital (More info?)

paul wrote:
> OK well thanks for some hints. Too many questions & having a tough time
> finding a good tutorial on this. I do have XP & was looking at something
> like:
>
> FORFILES -m*.tif -v
> -cC:\Program Files\IrfanView\i_view32.exe *.tif /convert=*.jpg
> >report.txt
>
> Anyways it does nothing, even the report is empty. I can't even see what
> it's doing with -v verbose. Ack. If anyone knows a good resource...

Hi...

Not much of a .bat guy; but it absolutely must do something.
Likely not what you want, but at least something :) 

Does it complain of not finding irfanview? And why the
re-direction?

Ken
Anonymous
February 20, 2005 9:39:28 PM

Archived from groups: rec.photo.digital (More info?)

paul wrote:
> OK well thanks for some hints. Too many questions & having a tough
> time finding a good tutorial on this. I do have XP & was looking at
> something like:
>
> FORFILES -m*.tif -v
> -cC:\Program Files\IrfanView\i_view32.exe *.tif /convert=*.jpg
> >report.txt
>
> Anyways it does nothing, even the report is empty. I can't even see
> what it's doing with -v verbose. Ack. If anyone knows a good
> resource...

What is FORFILES supposed to be? It's not a command on my XP system.
Google. OK, it's from the resource kit, so read the RK Help!

If you put my commands into a batch file named e.g. ProcessAll.cmd they
work. I've been using them for a couple of years until recently. Run the
file by typing ProcessAll at a command prompt. (Sorry if you already knew
this).

Cheers,
David
February 20, 2005 11:14:19 PM

Archived from groups: rec.photo.digital (More info?)

Ken Weitzel wrote:

>
>
> paul wrote:
>
>> OK well thanks for some hints. Too many questions & having a tough
>> time finding a good tutorial on this. I do have XP & was looking at
>> something like:
>>
>> FORFILES -m*.tif -v
>> -cC:\Program Files\IrfanView\i_view32.exe *.tif /convert=*.jpg
>> >report.txt
>>
>> Anyways it does nothing, even the report is empty. I can't even see
>> what it's doing with -v verbose. Ack. If anyone knows a good resource...
>
>
> Hi...
>
> Not much of a .bat guy; but it absolutely must do something.
> Likely not what you want, but at least something :) 
>
> Does it complain of not finding irfanview? And why the
> re-direction?


I double-click on the bat file and a dos window pops up & evaporates
before I can see anything. It makes the report.txt but it is empty.

I could try the ProcessAll.cmd idea but would have to navigate to the
folder or type a long path, etc.
Anonymous
February 21, 2005 3:36:14 AM

Archived from groups: rec.photo.digital (More info?)

Thanks for the reply!

I have very limited experience with dos, is it possible to show me an
example to get me started. U said that "i need to wrap this code to
visit all folders" how would i do that?

Also can i type this in notepad then execute it using the command
prompt!

Many thanks

Farouq



"David J Taylor" <david-taylor@blueyonder.co.not-this-bit.nor-this-part.uk> wrote in message news:<qTjRd.17441$8B3.8423@text.news.blueyonder.co.uk>...
> Farouq wrote:
> > Hi everyone,
> >
> > Is there a program the that can replace all my tiff files which are in
> > different directories to jpegs in the same directories.
> >
> > eg.
> >
> > i have several folders with tiff images. What i would like is select
> > all those folders and then tell it to convert all images (tiff) to
> > jpeg Images and copy back to those folders. Is there application out
> > there somewhere for this?
> >
> > I don't want to goto each individual folder and convert the images to
> > jpeg. I have paintshop pro 8 but don't think it can do this.
> >
> > cheers
> >
> > Farouq
>
> Paint Shop Pro does have a batch conversion tool, but you could also use
> IrfanView driven from the command-line:
>
> FOR %%I IN (*.tiff) DO (
> IF NOT EXIST %%~nI.jpg (
> C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.jpg
> )
> )
>
> (Windows 2000 command example, you would need to wrap this is code to
> visit all the folders to be converted).
>
> Cheers,
> David
Anonymous
February 21, 2005 7:49:04 AM

Archived from groups: rec.photo.digital (More info?)

paul wrote:

> Ken Weitzel wrote:
>
>>
>>
>> paul wrote:
>>
>>> OK well thanks for some hints. Too many questions & having a tough
>>> time finding a good tutorial on this. I do have XP & was looking at
>>> something like:
>>>
>>> FORFILES -m*.tif -v
>>> -cC:\Program Files\IrfanView\i_view32.exe *.tif /convert=*.jpg
>>> >report.txt
>>>
>>> Anyways it does nothing, even the report is empty. I can't even see
>>> what it's doing with -v verbose. Ack. If anyone knows a good resource...
>>
>>
>>
>> Hi...
>>
>> Not much of a .bat guy; but it absolutely must do something.
>> Likely not what you want, but at least something :) 
>>
>> Does it complain of not finding irfanview? And why the
>> re-direction?
>
>
>
> I double-click on the bat file and a dos window pops up & evaporates
> before I can see anything. It makes the report.txt but it is empty.
>
> I could try the ProcessAll.cmd idea but would have to navigate to the
> folder or type a long path, etc.

Hi Paul...

It's a good thing that we both speak English; cause we
sure don't speak the same batch :) 

Then again, I'm an old retired guy, so maybe things have
changed more than I know :) 

Anyway, humour me... try this, see what happens.

It's *all one line*!

Make a .bat out of it, in all one line, maybe add echo on
to the top of it. Verify that the path to i-view is correct.
Copy it to a junk directory, copy a few small valid .tif's
to the same directory, and let 'er rip, and let us know what
happens.

for %%a in (*.tif) DO c:\programs\irfanview\i_view32.exe %%a /convert=.jpg

Good luck, and take care.

Ken
February 21, 2005 11:57:05 AM

Archived from groups: rec.photo.digital (More info?)

Ken Weitzel wrote:

>
>
> paul wrote:
>
>> Ken Weitzel wrote:
>>
>>>
>>>
>>> paul wrote:
>>>
>>>> OK well thanks for some hints. Too many questions & having a tough
>>>> time finding a good tutorial on this. I do have XP & was looking at
>>>> something like:
>>>>
>>>> FORFILES -m*.tif -v
>>>> -cC:\Program Files\IrfanView\i_view32.exe *.tif /convert=*.jpg
>>>> >report.txt
>>>>
>>>> Anyways it does nothing, even the report is empty. I can't even see
>>>> what it's doing with -v verbose. Ack. If anyone knows a good
>>>> resource...
>>>
>>>
>>>
>>>
>>> Hi...
>>>
>>> Not much of a .bat guy; but it absolutely must do something.
>>> Likely not what you want, but at least something :) 
>>>
>>> Does it complain of not finding irfanview? And why the
>>> re-direction?
>>
>>
>>
>>
>> I double-click on the bat file and a dos window pops up & evaporates
>> before I can see anything. It makes the report.txt but it is empty.
>>
>> I could try the ProcessAll.cmd idea but would have to navigate to the
>> folder or type a long path, etc.
>
>
> Hi Paul...
>
> It's a good thing that we both speak English; cause we
> sure don't speak the same batch :) 
>
> Then again, I'm an old retired guy, so maybe things have
> changed more than I know :) 
>
> Anyway, humour me... try this, see what happens.
>
> It's *all one line*!
>
> Make a .bat out of it, in all one line, maybe add echo on
> to the top of it. Verify that the path to i-view is correct.
> Copy it to a junk directory, copy a few small valid .tif's
> to the same directory, and let 'er rip, and let us know what
> happens.
>
> for %%a in (*.tif) DO c:\programs\irfanview\i_view32.exe %%a /convert=.jpg
>
> Good luck, and take care.
>
> Ken


The echo makes it simply echo the line rather than execute.

I suspect "Program Files" in my path is not acceptable to DOS.
Hmm, if I copy irfanview.exe into my working folder, this works:
i_view32.exe *.tif /convert=*.jpg


Then I can get:
original.tif.jpg (kind of an odd name)
using:

mkdir web
for %%a in (*.tif) DO i_view32.exe %%a /convert=subfolder\%%a.jpg

Not sure how to get the original file name minus the ".tif"

Getting closer...

At least I got it to give me error messages when it has a problem now
instead of just blinking! Here's a semi-working version of what I want:

mkdir web\thumbs
for %%a in (*.tif) DO i_view32.exe %%a /resample=(640,640) /aspectratio
/sharpen=20 /convert=web\%%a.jpg
for %%a in (*.tif) DO i_view32.exe %%a /resample=(100,100) /aspectratio
/sharpen=20 /convert=web\thumbs\%%a.jpg

of course the sharpen doesn't work now unless I figure out the right way
to do a short file name through "Program Files" and the funny double
extension names. Or copy the sharpen plugin into my working folder also
<grin>.
Anonymous
February 21, 2005 1:45:24 PM

Archived from groups: rec.photo.digital (More info?)

Farouq wrote:
> Thanks for the reply!
>
> I have very limited experience with dos, is it possible to show me an
> example to get me started. U said that "i need to wrap this code to
> visit all folders" how would i do that?
>
> Also can i type this in notepad then execute it using the command
> prompt!
>
> Many thanks
>
> Farouq

Ah, so you sent me a direct e-mail as well as asking on the newsgroup -
please keep to the newsgroup so that others may learn as well.

Cheers,
David

---------- reply sent by -email ---------------

Yes, use Notepad to create a file named: ProcessFiles.bat, with the
contents in between the dashed lines. Replace <folder1> and <folder2>
with the folders you need processing. Please look the Internet for more
information about using DOS command files.

-----------------------------------------------------------------------------------
REM Convert the TIFF images to JPG

PUSHD C:\<folder1>
CALL :D o_folder
POPD

PUSHD C:\<folder2>
CALL :D o_folder
POPD

EXIT


:D o_folder

FOR %%I IN (*.tiff) DO (
IF NOT EXIST %%~nI.jpg (
C:\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.jpg
)
)
GOTO :EOF

-----------------------------------------------------------------------------------

Best regards,
David
Anonymous
February 21, 2005 8:03:59 PM

Archived from groups: rec.photo.digital (More info?)

paul wrote:
[]
> of course the sharpen doesn't work now unless I figure out the right
> way to do a short file name through "Program Files" and the funny
> double extension names. Or copy the sharpen plugin into my working
> folder also <grin>.

The correct way to specify a file name with spaces is to use quotes:

C:\programs\IrfanView.exe

"C:\Program Files\IrfanView.exe"

The batch file I gave earlier doesn't have the double extension names -
study it and have a look at HELP FOR at a command prompt.

Cheers,
David
February 21, 2005 8:04:00 PM

Archived from groups: rec.photo.digital (More info?)

David J Taylor wrote:

> paul wrote:
> []
>
>>of course the sharpen doesn't work now unless I figure out the right
>>way to do a short file name through "Program Files" and the funny
>>double extension names. Or copy the sharpen plugin into my working
>>folder also <grin>.
>
>
> The correct way to specify a file name with spaces is to use quotes:
>
> C:\programs\IrfanView.exe
>
> "C:\Program Files\IrfanView.exe"



Yes, thanks that works!


---------
convert.bat
---------
mkdir web\thumbs

for %%a in (*.tif) DO "c:\program files\irfanview\i_view32.exe" %%a
/resample=(640,640) /aspectratio /sharpen=20 /jpgq=67
/convert=web\%%a.jpg

for %%a in (*.tif) DO "c:\program files\irfanview\i_view32.exe" %%a
/resample=(100,100) /aspectratio /sharpen=20 /jpgq=40
/convert=web\thumbs\%%a.jpg
----------

The only thing funny is the names keep the old extension plus jpg


original.tif > original.tif.jpg
February 21, 2005 8:04:01 PM

Archived from groups: rec.photo.digital (More info?)

paul wrote:

> The only thing funny is the names keep the old extension plus jpg
>
>
> original.tif > original.tif.jpg

If the originals all have standard names, like image001.tif,
image002.tif, then the rename command with the ? wildcard might fix it:

rename ????????.tif.jpg ????????.jpb

If the originals have names like cat.tif and house.tif, then that won't
help.

Bob
Anonymous
February 21, 2005 10:00:34 PM

Archived from groups: rec.photo.digital (More info?)

paul wrote:
[]
> The only thing funny is the names keep the old extension plus jpg
>
>
> original.tif > original.tif.jpg

Look at what I did:

FOR %%I IN (*.tiff) DO (
IF NOT EXIST %%~nI.png (
e:\wu\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.png
)
)

At the command prompt, type HELP FOR for more info about "%%~nI.tiff "

Cheers,
David
Anonymous
February 22, 2005 8:27:39 AM

Archived from groups: rec.photo.digital (More info?)

paul wrote:


<anip>

> The echo makes it simply echo the line rather than execute.

Hi Paul...

In a bat file, echo on just echoes the line to your monitor; and then
it does indeed execute it - if it's able to.

Very very helpful for debugging - if there are errors, then you find
them easily by seeing the last line called (as you did)

Nice for more complex huge ones, too. Specially those with
lots of labels - you can watch the jumps, pick out any wrong ones :) 

Take care.

Ken

<snip>
February 22, 2005 11:59:58 AM

Archived from groups: rec.photo.digital (More info?)

David J Taylor wrote:

> paul wrote:
> []
>
>>The only thing funny is the names keep the old extension plus jpg
>>
>>
>>original.tif > original.tif.jpg
>
>
> Look at what I did:
>
> FOR %%I IN (*.tiff) DO (
> IF NOT EXIST %%~nI.png (
> e:\wu\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.png
> )
> )
>
> At the command prompt, type HELP FOR for more info about "%%~nI.tiff "


OK I see. This works:

mkdir web\thumbs

FOR %%I IN (*.tif) DO (
"c:\program files\irfanview\i_view32.exe" %%~nI.tif
/convert=web\%%~nI.jpg
)

But it just blinks if I add in more irfanview options to resize:

%%~nI.tif /resample=(100,100) /aspectratio /sharpen=20 /jpgq=40


so the following does not work:

FOR %%I IN (*.tif) DO (
IF NOT EXIST %%~nI.jpg (
"c:\program files\irfanview\i_view32.exe" %%~nI.tif
/resample=(100,100) /aspectratio /sharpen=20 /jpgq=40
/convert=web\thumbs\%%~nI.jpg
)
)

Adding "echo" as the first line does nothing and adding ">report.txt"
does nothing, not even an empty file.
Anonymous
February 22, 2005 8:24:23 PM

Archived from groups: rec.photo.digital (More info?)

paul wrote:
> David J Taylor wrote:
>
>> paul wrote:
>> []
>>
>>> The only thing funny is the names keep the old extension plus jpg
>>>
>>>
>>> original.tif > original.tif.jpg
>>
>>
>>
>> Look at what I did:
>>
>> FOR %%I IN (*.tiff) DO (
>> IF NOT EXIST %%~nI.png (
>> e:\wu\IrfanView\i_view32.exe %%~nI.tiff /convert=%%~nI.png
>> )
>> )
>>
>> At the command prompt, type HELP FOR for more info about "%%~nI.tiff "
>
>
>
> OK I see. This works:
>
> mkdir web\thumbs
>
> FOR %%I IN (*.tif) DO (
> "c:\program files\irfanview\i_view32.exe" %%~nI.tif
> /convert=web\%%~nI.jpg
> )
>
> But it just blinks if I add in more irfanview options to resize:
>
> %%~nI.tif /resample=(100,100) /aspectratio /sharpen=20 /jpgq=40
>
>
> so the following does not work:
>
> FOR %%I IN (*.tif) DO (
> IF NOT EXIST %%~nI.jpg (
> "c:\program files\irfanview\i_view32.exe" %%~nI.tif
> /resample=(100,100) /aspectratio /sharpen=20 /jpgq=40
> /convert=web\thumbs\%%~nI.jpg
> )
> )
>
> Adding "echo" as the first line does nothing and adding ">report.txt"
> does nothing, not even an empty file.

Hi Paul...

David's way ahead of me on this.... probably much
younger, and hopefully not a stroke victim... so I'll
leave the rest to him, but I can happily speak to the
echo and re-direction parts...

Use echo on one of three ways...

Echo off simply turns it off if it was on.

Echo on says from this point on, do whatever it was
you plan on doing, but *also* first echo the command
line to the "standard ouput" (the screen, more follows)

Echo and a word or phrase says just echo this to the
screen... for use as a remark or instruction, or
whatever. Try this just for the heck of it:
echo david is smarter at bat than ken is
Nothing will happen except that line will appear
on your screen.

To touch on re-direction, the > (greater than) symbol...
I mentioned standard output. The "standard output" of
print on your machine is of course the monitor.
If you re-direct it, you change the output to whatever
your redirect it to. So, try this just for the heck
of it:
dir > junk.txt
You'll not see a directory listing. You'll not see
anything, other than the prompt come back. You will find a
file created in the current directory named junk.txt;
and it will be a directory listing. The screen has
been re-directed to that file.

Hope this is a tiny bit helpful.

Ken
Anonymous
February 22, 2005 8:40:33 PM

Archived from groups: rec.photo.digital (More info?)

Ken Weitzel wrote:
[]
> David's way ahead of me on this.... probably much
> younger, and hopefully not a stroke victim... so I'll
> leave the rest to him, but I can happily speak to the
> echo and re-direction parts...

Judge for yourself, Ken:

http://www.david-taylor.myby.co.uk/images/David05.jpg

Fortunately still in good health, but the grey hair isn't artificial!

Cheers,
David
!