Announcement

Collapse
No announcement yet.

Odd behavior for /import_pal in CMD file, but OK when used in command line

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Odd behavior for /import_pal in CMD file, but OK when used in command line

    Hi--

    I have the following code saved in a file named iv_batch.cmd
    Code:
    [COLOR="Green"]
    @echo off
    cd "%1"
    for %%z in (*.gif) do "c:\program files\irfanview 4.10\i_view32.exe" 
       "%%z" /gray /rotate_r /convert="%%~nz.jpg" 
    pause
    :end[/COLOR]
    and it sits in the same folder as i_view32.exe. In that same folder is another folder named batch_image_conversions.
    When I drag batch_image_conversions onto iv_batch.cmd, it works correctly (all gif images converted to jpg, grayscale, and rotated to the right).

    However, if I try to achieve the same result by using
    for %%z in (*.gif) do "c:\program files\irfanview 4.10\i_view32.exe" "%%z" /import_pal=grayscale.pal /rotate_r /convert="%%~nz.jpg" (grayscale.pal is a palette file)
    I get the gifs converted to jpgs and rotated to the right, but no grayscale. I tried using a few different palettes, but with no luck.

    What's odd is that essentially the same thing typed at the command line:
    >i_view32 foo.gif /import_pal=grayscale.pal /rotate_r /convert=foo.jpg
    works as expected!

    Any suggestions on how to get /import_pal working correctly in my iv_batch.cmd?
    "Never do today what you can put off until tomorrow" -- Bizarro Ben Franklin

    #2
    Hi d012560c,

    Where is your file grayscale.pal? In the same directory as i_view32.exe or in the same directory as your gif files (there is a cd in your batch). Did you try to give the full path of your grayscale.pal?

    Laurent
    Before you post ... fill in your OS and IV version in your profile.

    Comment


      #3
      Re: Odd behavior for /import_pal in CMD file, but OK when used in command line

      Hi Laurent,

      Everything is sitting in the same folder as i_view32. The only thing sitting inside the folder batch_image_conversions are the before and after images. Because of that and the fact that the command line version produced correct results, I didn't occur to me to try including the full path to grayscale.pal.

      Well guess what? It now works correctly when the full path is thrown in! I have no idea why this should be necessary for /import_pal when it wasn't needed at the command line. Any idea why this might be so?

      Thank you so very much for your help!
      Last edited by d012560c; 09.11.2007, 08:27 PM.
      "Never do today what you can put off until tomorrow" -- Bizarro Ben Franklin

      Comment


        #4
        Hi Hi d012560c,,

        Originally posted by d012560c View Post
        Well guess what? It now works correctly when the full path is thrown in! I have no idea why this should be necessary for /import_pal when it wasn't needed at the command line or when other command line options (such as /rotate_r or /gray) didn't need it. Any idea why this might be so?
        In your cmd file you make a cd to go to the directory where your gif images are. A filename without path will be found only in that directory. Your palette is somewhere else so you need to give its full path.

        Laurent
        Before you post ... fill in your OS and IV version in your profile.

        Comment

        Working...
        X