4 Replies Latest reply on Sep 19, 2013 8:43 AM by ILJefe

    Building automation to Resize by fileweight and dimension. I'm so close. Any ideas?

    ILJefe

      Greetings,

       

      I'm pretty new to the JS world but have been using Photoshop for the better part of 2 decades and have ALWAYS wanted something that would let me set filesize/weight limitations. The world appears to have given up before me (which should be a sign to stop?) but I can't give up now; that, and my employer has asked me to figure this out. So here I am asking for your help.

       

      Here's a gist of the code I have. It is "sorta" working but for some reason with larger file sizes it seems to make the file larger, then smaller etc etc. and loops infinitely. I'm thinking somehow it keeps grabbing an older version of the file, and possibly my problem might be in the saving procedure. ANY input would be extermely welcome, including suggestions on how to accomplish things more elegantly etc.

       

      https://gist.github.com/anonymous/95374b5e3db88261ce4c

       

      Basically I need to get the file down below 95k. First by lowering quality (because it is all that is necessary for MOST of the files I am handing in) to a limit of 50% then begin lowering size by 72px until the lower limit of pixel dimension it met.

       

      Ideas?