Announcement

Collapse
No announcement yet.

command line convert

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

    command line convert

    Hy,

    i have a problem whit my command (.bat) code
    Code:
    cd "d:\Program Files\IrfanView"
    i_view32.exe D:\images\before\*.jpg /resize=(100,90) /aspectratio /resample /jpgq=100 /convert=D:\images\after\pic$X##.jpg
    i would take all pictures (*.jpg) from the folder "before" then i would resize this, convert and rename to folder "after" in this folder it sould look like pic1 pic2 pic3 asa...
    but the consecutive number would not funktion, i dont know why?
    maybe i must to declare the index of $X so that he know begin @01 next is +1 !
    but i dont know how can i make this.

    i hope someone can help me.

    PS: sry guys for my bad english im from austria

    lg
    /yesuar

    #2
    Your English is fine. The conversion and naming...ach! I think we have a command line bug. The consecutive naming works fine through the batch dialog, but multiple naming with the command line is tricky. I have struggled with this off and on.

    What happens is that IF all the files are processed, they overwrite one another until the last one sits there smiling as 01.jpg or whatever. Name patterns other than $X can work all right, the numbers can be added to the existing file name. But that's not what we want

    I tried some crazy variations - it has been fun, or at least interesting.
    Its: Belongs to "It"
    It's: Shortened form of "It is"
    ---------------------
    Lose: Fail to keep
    Loose: Not tight

    ---------------------
    Plurals do not require apostrophes

    Comment


      #3
      Hy all,

      i have no idea why the $X variable works not correct, ore how you can declare there (also the complete help ore docu-file bring no answer).
      but here is an .bat script from derniwi.

      it works wonderful
      Code:
      @echo off
      
      set /a picnumber=1
      set sourcepath=D:\pics\images
      set destinationpath=D:\pics\thumbs
      set destinationname=pic
      set filetype=jpg
      
      set iview="d:\Program Files\IrfanView\i_view32.exe"
      
      for /f "delims=" %%a in ('dir /b /on "%sourcepath%\*.%filetype%"') do call :dissipate  "%destinationpath%\%%a"
      goto end
      
      :dissipate 
      set number=%picnumber%
      set number=%number:~-4%
      call :convert %1 "%destinationpath%\%destinationname%_%number%.%filetype%"
      set /a picnumber+=1
      goto :eof
      
      :convert
      %iview% %1 /resize=(100,90) /aspectratio /resample /jpgq=100 /convert=%2
      goto :eof
      
      :end
      it takes all pictures from "D:\pics\images" convert and rename this in pic1, pic2, pic3 asa... to "D:\pics\thumbs"

      lg
      /yesuar

      Comment

      Working...
      X