Skip to main content
Participant
June 2, 2009
Answered

export to jpeg permissions problem

  • June 2, 2009
  • 2 replies
  • 2047 views

The export to jpeg bridge extension works great except all the images are saved with permissions for the group 'everyone' with 'No Access' - which causes problems showing images for the web. I have to manually change permissions to 'Read Only'.

I've been trying to troubleshoot for hours to no avail. Anyone else run into this problem?

Using Mac OS 10.5.7 - Bridge CS4 - BridgeExportToJpegCS4

This topic has been closed for replies.
Correct answer dfranzen_camera_raw

The attachment failed, here is the script:

-David

////////////////////////////////////////////////////////////////////////////
// ADOBE SYSTEMS INCORPORATED
// (c) Copyright 2009 Adobe Systems Incorporated. All Rights Reserved
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
// with the terms of the Adobe license agreement accompanying it. If you have
// received this file from a source other than Adobe, then your use, modification,
// or distribution of it requires the prior written permission of Adobe.
////////////////////////////////////////////////////////////////////////////


/**
*    Each Post-Processinig script must result in a JavaScript object
*     with a function named proocess()*/
var makeWorldReadable = {};

// You can maintain state between calls to process()
// by adding custom properties to your post-processor object.
makeWorldReadable.counter = 0;

/**
* The process() function accetps an array of objects
* representing the exported JPEGs. It should return nothing.
*/
makeWorldReadable.process = function( exportsArray )
{
    /*
    * The exportsArray is an array of ojbects, each with the following propertyes..
    * originalUri: The Bridge URI for the Thumbnaili object from which the JPEG was exported.
    * exportPath: The file-system path to the exported JPEG.
    */

    for( ex in exportsArray )
    {
        var exportInfo = exportsArray[ex];
        var chmodCommand = "chmod o+r \"" + exportInfo.exportPath + "\"";
        this.log( chmodCommand );
        app.system( chmodCommand );
    }
}

/*
* Your post-processor object may define and use
* it's own utility functions.
*/
makeWorldReadable.log =function( info )
{
    //$.writeln( info );
}

makeWorldReadable;

2 replies

crockejAuthor
Participant
June 19, 2009

Works like a charm!

Really appreciate the fix.

Thanks

dfranzen_camera_raw
Adobe Employee
Adobe Employee
June 19, 2009

Not making the files world-readable is not be design, it seems to be the default behavior when a script in Bridge creates a JPEG file. (EportToJpeg is a script.) I'll have to do some research about why this is the case.

For now, you can take advantage of ExporToJpeg's post-processing feature to change the permissions after export.

Where ExportToJpeg is installed on your computer you'll find a folder named "sample scripts"...

~/Library/Application\ Support/Adobe/Bridge\ CS4/Startup\ Scripts/ExportToJpeg/sample\ scripts

You'll find here a very basic example post-processing script, "Demo Logging Post-Processor.jsx". Make a copy of the script and replace lines 42-45 with code that does something useful -- in this case changes the permissions.

var chmodCommand = "chmod o+r \"" + exportInfo.exportPath + "\"";
app.system( chmodCommand );

Note that I've been careful to quote the export path incase it has spaces in it. Also this is a Mac only example; for windows use whatever command line is the equivalent of chmod.

I've attached the finished script to this post.

Once you have finished your custom script, go to the Edit > Export to JPEG > Reveal Custom Post-Processing Scripts menu item. This will make Bridge navigate to the folder where you can install post-processing scripts for ExportToJpeg. Add your script to this folder.

After installing the script bring up Export To JPEG's preset editing dialog. In the Post Processing section check the check box "Execute JavaScript". Select your script from the combo box and choose the option "Run Script after Exporting All Files" (the default). If you export JPEGs using this option, they should end up with the permissions you want.

Of course you can also extend this example to add whatever kind of custom post-processing automation you want.

-David

dfranzen_camera_raw
Adobe Employee
dfranzen_camera_rawCorrect answer
Adobe Employee
June 19, 2009

The attachment failed, here is the script:

-David

////////////////////////////////////////////////////////////////////////////
// ADOBE SYSTEMS INCORPORATED
// (c) Copyright 2009 Adobe Systems Incorporated. All Rights Reserved
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
// with the terms of the Adobe license agreement accompanying it. If you have
// received this file from a source other than Adobe, then your use, modification,
// or distribution of it requires the prior written permission of Adobe.
////////////////////////////////////////////////////////////////////////////


/**
*    Each Post-Processinig script must result in a JavaScript object
*     with a function named proocess()*/
var makeWorldReadable = {};

// You can maintain state between calls to process()
// by adding custom properties to your post-processor object.
makeWorldReadable.counter = 0;

/**
* The process() function accetps an array of objects
* representing the exported JPEGs. It should return nothing.
*/
makeWorldReadable.process = function( exportsArray )
{
    /*
    * The exportsArray is an array of ojbects, each with the following propertyes..
    * originalUri: The Bridge URI for the Thumbnaili object from which the JPEG was exported.
    * exportPath: The file-system path to the exported JPEG.
    */

    for( ex in exportsArray )
    {
        var exportInfo = exportsArray[ex];
        var chmodCommand = "chmod o+r \"" + exportInfo.exportPath + "\"";
        this.log( chmodCommand );
        app.system( chmodCommand );
    }
}

/*
* Your post-processor object may define and use
* it's own utility functions.
*/
makeWorldReadable.log =function( info )
{
    //$.writeln( info );
}

makeWorldReadable;