home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Misc / HTMLCAT203.LHA / Rexx / MKVignettes_GfxCon17.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1997-05-19  |  2.4 KB  |  127 lines

  1. /*
  2. ** Creation de Vignettes (c) Jimmy Productions 1997 
  3.  
  4. ** Crée des vignettes à partir d'une liste d'images
  5.  
  6. ** Pour GFXcon V1.7 (c) Dirk Farin 
  7.  
  8. */
  9.  
  10. NL = '0A'X
  11. SQ = '27'X
  12. DQ = '22'X
  13. TRUE  = 1
  14. FALSE = 0
  15.  
  16. PARSE ARG argu
  17.  
  18. File_path = WORD(argu,1)
  19. Sheight = WORD(argu,2)
  20. FilesList = ""
  21.  
  22. open('file', 't:htmlcat12.tmp', 'R')
  23.  
  24. nom = readln('file')
  25.  
  26. DO WHILE nom ~=""
  27.     FilesList = Fileslist||DQ||nom||DQ||" "
  28.     nom = readln('file')
  29. END
  30.  
  31. close('file')
  32.  
  33. /*
  34. ** ----------------------------------------------------------
  35. ** Partie specifique adpro finie debut processus d'indexation
  36. ** ----------------------------------------------------------
  37. */
  38.  
  39. ExtensionList:
  40.  
  41. pref = "v"
  42.  
  43. /*
  44. ** ----------------
  45. ** boucle multi-idx
  46. ** ----------------
  47. */
  48.  
  49. OneMoreTime:
  50.  
  51. Bool_Arret = FALSE
  52. Bool_LastFile = FALSE
  53. PosCut = 1
  54.  
  55. DO WHILE Bool_LastFile = FALSE
  56.  
  57. /* ! chargement ! */
  58.  
  59.     ListCut=POS('" "',FilesList,PosCut)
  60.  
  61.     IF ListCut = 0 THEN DO
  62.         Bool_LastFile = TRUE
  63.         ListCut = LENGTH(FilesList)
  64.     END
  65.  
  66.     Length_FileName = ListCut - PosCut + 1
  67.     File_to_Load = SUBSTR(FilesList,PosCut,Length_FileName)
  68.  
  69.  
  70.     AnteCut = PosCut
  71.     PosCut = ListCut+2
  72.  
  73.     ErrLoad = FALSE
  74.  
  75. /* On recupere les info de l'image données par GfxCon <img> INFO*/
  76. /* retour de gfxcon : `input size: width x height ' */
  77. /* Modifier ici si gfxcon INFO renvoie autre chose  */
  78. /* algo : */
  79. /*   On lit le fichier jusqu'a trouver la chaine `input size:' */
  80. /*   On cherche la position de ' x ' et on sait que la hauteur est derriere ca */
  81. /*   On recupere la hauteur */
  82.  
  83.     ADDRESS COMMAND "gfxcon "|| File_to_Load ||" INFO >t:gfxcon.res"
  84.  
  85.     open('file2', 't:gfxcon.res', 'R')
  86.     
  87.     heigh = readln('file2')
  88.  
  89.     DO WHILE index(heigh,"input size:") = 0 & height ~=""
  90.         heigh = readln('file2')
  91.     END
  92.     close('file2')
  93.     IF index(heigh,"input size:") ~= 0 THEN DO
  94.      h = index(heigh," x ")
  95.      Height = SUBSTR(heigh,h+3)
  96.     END
  97.     
  98. /* Calcul du ratio pour ` resize f ' option */
  99.  
  100.     ratio = (Sheight/Height)
  101.  
  102.     posit=1
  103.  
  104.     posit = POS(':',File_to_Load,posit)
  105.     nposit= posit
  106.  
  107.     DO WHILE nposit ~= 0
  108.         nposit = POS('/',File_to_Load,posit+1)
  109.         IF nposit ~=0 THEN DO
  110.             posit = nposit 
  111.         END
  112.     END
  113.  
  114.     File_pat  = SUBSTR(File_to_Load,1,posit)
  115.     File_name = SUBSTR(File_to_Load,posit+1,LENGTH(File_to_Load)-posit-1)
  116.         lc = POS('"',File_name,1)
  117.  
  118.     IF lc ~= 0 THEN DO
  119.             File_name = SUBSTR(File_name,1,lc-1)
  120.     END
  121.  
  122.     ADDRESS COMMAND "gfxcon " || File_to_load || " TO " || File_path||pref||File_name  || " RESIZE " || ratio || " FORMAT JPEG QUALITY 10 "
  123.  
  124. END
  125.  
  126. Exit
  127.