1 Reply Latest reply: Mar 21, 2012 2:46 AM by Paul Riggott RSS

    Bridge to create thumbnails from web application

    marius_9 Community Member

      Hi all,

       

      I'm looking for a solution to create thumbnails on my web application server (eps, ai, psd.. files).

      Did you think that it a good idea (and possible) to use Bridge on a server (I have a licnese for InDesign server) to generate thumbnails with a jsx script ?

       

      Thanks,

      Cedric

        • 1. Re: Bridge to create thumbnails from web application
          Paul Riggott Community Member

          I have no idea about using Bridge on a server, but here is an example of creating thumbnails.

          This example should be run from ExtendScript Toolkit, it will generate thumbnails for all (that it can)  filetypes in the selected folder.

           

           

          #target bridge
          var files = app.document.visibleThumbnails; 
          for(var a in files){
              if(files[a].type == "file"){
              var Thumb = new Thumbnail(files[a]);
              var orientation = Thumb.rotation;
              app.synchronousMode = true; 
              var bm = Thumb.core.thumbnail.thumbnail;
              app.synchronousMode = false;
              if(bm.width <1) continue;
              bm = bm.rotate(orientation);
              Name = decodeURI(Thumb.spec.name).replace(/\.[^\.]+$/, '');
              var target = new File(app.document.presentationPath + "/Thumb-" + Name + ".jpg" );
              bm.exportTo(target);
                  }
          }