kh5ura
Last Updated: April 13, 2017
·
6.274K
· imaginary
Foto 08.03

Photoshop EPS to JPG Batch Processing ...

Had to convert a bigger bunch of EPS to JPG today ...

So I wrote myself a little Conversion Tool that does it properly as the native Batch Tools are either missing Settings for EPS or they simply don't work as intended (at least on the Systems this has been tested and used on).

What it does:

Doesn't spam Popups neither requires manual fiddling with the Files.

  1. Grabs all EPS out of a Folder
  2. Rasterizes it depending on your set dimensions and quality (Different Settings for Portrait, Landscape and Quadratic Pictures possible)
  3. Saves the EPS-Files as JPG to another Folder
  4. Only throws a popup when it 's done or failed
  5. Profit

Settings (global for all EPS-Files, set at each start):

Global DPI
Global JPEG-Quality
Portrait-Picture Width (Leave empty for no resize)
Landscape-Picture Width (Leave empty for no resize)
Quadratic-Picture Width (Leave empty for no resize)

Install Instructions:

  1. Grab the Javascript-Source (.jsx) from: http://jsfiddle.net/Q2rgj/1/
  2. Save it in: [YOUR PHOTOSHOP FOLDER]/Presets/Scripts/eps-to-jpg.jsx
  3. Restart Photoshop
  4. Access it under Photoshop -> Automation -> ESP->JPG (Batch Processing)!
  5. Profit

Cheers

Tested with

  • Photoshop CS5 Mac OS 10.6.8
  • Photoshop CC Win7 64-Bit

Screenshot:

Picture


Edit:

Seems like link is broke due to a bug with coderwall and external links. Here 's the source directly:

#target photoshop  

/*
// BEGIN__HARVEST_EXCEPTION_ZSTRING

<javascriptresource>
<name>EPS->JPG (Batch Processing)</name>
<menu>automate</menu>
</javascriptresource>

// END__HARVEST_EXCEPTION_ZSTRING
*/

 var dlgResource = "dialog { \
    text: 'EPS->JPG (Batch Processing)', \
    alignChildren: ['fill', 'top'],  \
    misc_settings: Panel { \
        margins:15, \
        alignChildrens:'left', \
        text: 'Misc Settings', \
        dpi: Group {\
            label: StaticText { text: 'DPI:',  preferredSize: [60,24] }, \
            value: EditText { text: '72', characters: 10, justify: 'right',  preferredSize: [140,24]} \
        },\
        quality: Group { \
            label: StaticText { text: 'Quality:',  preferredSize: [60,24] }, \
            value: Group { \
                alignChildren:'left', \
                orientation: 'stack' ,\
                edit: EditText { text: '60', justify:'right', preferredSize: [140,24] } \
            } \
        },\
   }, \
     q_picSettings: Panel { \
        orientation: 'row', \
        alignChildren: 'left', \
        margins:15, \
        text: 'Landscape Pictures', \
        widthLabel: StaticText { text: 'Width:',  preferredSize: [60,24] }, \
        widthValue: EditText { text: '1000', characters: 10, justify: 'right',  preferredSize: [140,24]} \
    }, \
    h_picSettings: Panel { \
        orientation: 'row', \
        alignChildren: 'left', \
        margins:15, \
        text: 'Portrait Pictures', \
        widthLabel: StaticText { text: 'Width:',  preferredSize: [60,24] }, \
        widthValue: EditText { text: '500', characters: 10, justify: 'right', preferredSize: [140,24]} \
    }, \
    qu_picSettings: Panel { \
        orientation: 'row', \
        alignChildren: 'left', \
        margins:15, \
        text: 'Quadratic Pictures', \
        widthLabel: StaticText { text: 'Width:',  preferredSize: [60,24] }, \
        widthValue: EditText { text: '500', characters: 10, justify: 'right',  preferredSize: [140,24]} \
   }, \
   bottomGroup: Group{ \
        btnOK: Button { text: 'Continue', properties:{name:'ok'}, size: [120,24], alignment:['left', 'center'] }, \
        btnCancel: Button { text: 'Cancel', properties:{name:'cancel'}, size: [120,24], alignment:['right', 'center'] }, \
    }\
}";

var dlg = new Window(dlgResource);
dlg.center();

/*
var quality_list = new Array('10', '20', '30', '40', '50', '60', '70', '80', '90', '100');

for(var i = 0; i < quality_list.length; i++){
  dlg.misc_settings.quality.value.list.add('item', quality_list[i]);
}

dlg.misc_settings.quality.value.edit.onChange = function() { dlg.misc_settings.quality.value.list.show(); }
dlg.misc_settings.quality.value.list.onChange = function () {dlg.misc_settings.quality.value.edit.text = list.selection.text;  }
*/

if ( 1 == dlg.show() ) {
    var inputFolder = Folder.selectDialog("Select the Folder with the EPS-Sourcefiles.");  
    var OutputFolder = Folder.selectDialog("Select the Folder in which the JPG-Targetfiles should be saved.");  

} else {
  alert('EPS->JPG\nBatch Processing canceled.');
}

if ( inputFolder != null && OutputFolder  != null ) {  

    // Makes list of all files located in that folder  
    var fileList = inputFolder.getFiles( "*.eps" );  

    // Create a EPS option object [height & width are doc size]  
    var eps_oo = new EPSOpenOptions();  

    eps_oo.antiAlias = true;  
    eps_oo.mode = OpenDocumentMode.RGB;
    eps_oo.constrainProportions = true;  
    eps_oo.resolution = (dlg.misc_settings.dpi.value.text) ? parseInt(dlg.misc_settings.dpi.value.text):72;

    // Open each file in turn  
    for (var i = 0; i < fileList.length; i++) {  

        // open the file once unmodified for getting the file constrains
        app.open( fileList[i], eps_oo );  

        var w = activeDocument.width;
        var h = activeDocument.height;

        activeDocument.close( SaveOptions.DONOTSAVECHANGES );  

        //modifiy settings for loading our scaled image
        eps_oo.constrainProportions = eps_oo.constrainProportions;
        eps_oo.resolution = eps_oo.resolution;

        //portrait
        if(w > h && dlg.q_picSettings.widthValue.text != "") {
            eps_oo.width = parseInt(dlg.q_picSettings.widthValue.text);
        //landscape
        } else if(w < h && dlg.h_picSettings.widthValue.text != "") {
            eps_oo.width = parseInt(dlg.h_picSettings.widthValue.text);
        } else if(w = h && dlg.qu_picSettings.widthValue.text != "") {
            eps_oo.width = parseInt(dlg.qu_picSettings.widthValue.text);            
        }

        // open the file again width our choosen width
        app.open( fileList[i], eps_oo);  

        var baseName = activeDocument.name.slice( 0,-4 );  

        // put your code to 'save as' the file here  
        var saveFile = new File ( OutputFolder + "/" + baseName + ".jpg" );  
        var quality = 60;

        if(dlg.misc_settings.quality.value.edit.text != "")  {
            quality = parseInt(dlg.misc_settings.quality.value.edit.text);
            quality = (quality >= 100) ? 100:quality;
            quality = (quality <= 0) ? 0:quality;
        }

        SaveForWeb(saveFile,quality); // set quality to suit  

        function SaveForWeb(saveFile,jpegQuality) {  
            var sfwOptions = new ExportOptionsSaveForWeb();   
            sfwOptions.format = SaveDocumentType.JPEG;   
            sfwOptions.includeProfile = false;   
            sfwOptions.interlaced = 0;   
            sfwOptions.optimized = true;   
            sfwOptions.quality = jpegQuality;  

            activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);  

        };    

        activeDocument.close( SaveOptions.DONOTSAVECHANGES );    

    };  

    alert('EPS->JPG\nBatch Processing successfully finished.');

};  
Say Thanks
Respond

9 Responses
Add your response

17314
Efde0d95d4e801671176cd87ff7fdfac normal

Thank you, its really great tool, and give me much support to convert tones of EPS to JPG on one click

over 1 year ago ·
20109
0 jqfqx6bc3is2jxxvrrbzxkbc uf80vavuz1jxkqyy7rkhyjsv ceex8ksx7xyjf94clzii6czzjr

Thanks very much for this, Simon. I can confirm that it works fine with Photoshop CS6 64 bit for PC. It was very easy to implement using your instructions, and I even jumped the default sizes up a bit to save changing them every time.
I am very grateful for your generous sharing of this excellent tool.
John C

over 1 year ago ·
20721
Efde0d95d4e801671176cd87ff7fdfac normal

Thank You very much, I have tested it wit PS CC 2014 on OS X 10.10.3

over 1 year ago ·
26396
0 sevdfpefl0 hwepxdis9fyibbv9xim x7sanfxsbzjgqqolk3uolt0amwtnrew1huw4ch4ejhv f

Link don't work :-(

over 1 year ago ·
26612
Foto 08.03

Must be a bug with coderwall that adds rel="nofollow" to the href for external links.

I've edited the ProTip to include the source at the bottom.

Cheers

over 1 year ago ·
27307

This is brilliant - I just tested this on Photoshop Creative Cloud (PS CC) 2015.
I was emailed a large set of EPS files and wanted a quick way to convert them all to high resolution Jpegs for a Website, This script saved me hours.
Easy to install, great instructions.

over 1 year ago ·
27435
314logo bigborder

Does NOT work with CS5 Extended - Version 12.1 x32 (or x64) - Windows 8 ...

Error 8000: Cannot open the file because the file open options are incorrect. Line 103 (Then it shows what is on line 103).

Thoughts? Maybe I'll just use a different computer :)

over 1 year ago ·
28469
Hjklogo

Worked magically on cs6x64. Thanks

11 months ago ·
28797

Great script, but: If you use an EPS with already filled in meta data, those datas are getting lost after the JPEG was created.
Especially the keywords and the description are getting deleted.

Can you fix this?

7 months ago ·