• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Bridge Script to Add Missing Resolution Metadata to Exported JPEG Files

Community Expert ,
Nov 19, 2022 Nov 19, 2022

Copy link to clipboard


This script will add 300ppi resolution metadata to selected JPEG files (JPG or JPEG extensions). This may be desired when making use of Photoshop's Export features which are designed to strip irrelevant metadata that is not required for web/device viewing. Some users still wish to have the resolution metadata included, but do not wish to use Save As/Save As a Copy which includes all metadata.


This is a continuation of the topic in the Photoshop forum where I created a couple of similar scripts for Photoshop:




Set JPEG Resolution Metadata to 300ppi.jsx
v1.0, 19th November 2022, Stephen Marsh
Add the stripped resolution metadata back to exported JPEG files

#target bridge

if (BridgeTalk.appName == "bridge") {
    addResMeta = new MenuElement("command", "Set JPEG Resolution Metadata to 300ppi", "at the end of Tools");

addResMeta.onSelect = function () {

    //var sels = app.document.selections;
    var sels = app.document.getSelection("jpg, jpeg");

    for (var i = 0; i < sels.length; i++) {
        var thumb = sels[i];
        var md = thumb.metadata;
        var res = 300;

        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.XResolution = res;
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.DisplayedUnitsX = 'inches';
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.YResolution = res;
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.DisplayedUnitsY = 'inches';

        md.namespace = "http://ns.adobe.com/tiff/1.0/";
        md.XResolution = res;
        md.namespace = "http://ns.adobe.com/tiff/1.0/";
        md.YResolution = res;
        md.namespace = "http://ns.adobe.com/tiff/1.0/";
        md.ResolutionUnit = 2;

        // Appears to be a bug that this doesn't work as expected when called from a script
    // Prompt user to purge cache for the folder (to force an update of the displayed metadata for all files)




Metadata , Scripting






Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation