Skip to main content
Participating Frequently
March 21, 2012
Question

Bridge to create thumbnails from web application

  • March 21, 2012
  • 1 reply
  • 916 views

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

This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
March 21, 2012

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.type == "file"){

    var Thumb = new Thumbnail(files);

    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);

        }

}