1 Reply Latest reply on Nov 12, 2016 2:43 AM by tssee@imgof.com

    "file.length" is not accuracy

    YaoyongYu Level 1
      var saveFile = new File(et_outpath.text + "/" + (m + 1) + "_" + (n + 1) + houzui);
                      do {
                      qlty = qlty-5;
                      saveFile=new File(exportWeb (saveFile,qlty,format,png8))
                      saveFile.remove();
                      exportWeb (saveFile, qlty, format,png8);
                           if (qlty<=0){ 
                               alert("无法压缩至指定文件大小"); 
                                  app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
                                  ac_doc.selection.deselect();
                                  w.enabled = true;
                                  bt_cut.text = "开始";
                                  return;
                              }
                      } while (saveFile.length > parseInt(et_imgkb.text)*1024)
               app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
      

       

      QQ截图20161112172153.png