5 Replies Latest reply on Jul 31, 2018 2:22 PM by Stephen_A_Marsh

    change resolution

    Sashikala Balasubramanian Level 1

      Is it posible to change the resolution while opening the tiff file in Photoshop using openOptions.

       

      regards,

      Sashi

        • 1. Re: change resolution
          xbytor2 Level 4

          There is no TiffOpenOptions object in the JS DOM, so the answer is no. You'll have to open and the change the resolution in separate steps.

          • 2. Re: change resolution
            Sashikala Balasubramanian Level 1

            The resolution property is read only. What is the method to change the resolution after opening the tiff file in Photoshop.

            • 3. Re: change resolution
              Michael L Hale Level 5

              Just like in the GUI you change the resolution with image size.

              docRef.resizeImage(undefined, undefined, 300, ResampleMethod.NONE );
              
              • 4. Re: change resolution
                Paul Riggott Level 6

                If you only want to change the resolution it could be done in Bridge.

                #target bridge
                var newRes="300";
                    try{
                          loadXMPLib();
                          var thumb = new Thumbnail( app.document.selections[0] );
                          app.synchronousMode = true;
                          var xmp = new XMPMeta(thumb.synchronousMetadata.serialize());
                          var ResX = xmp.setProperty( XMPConst.NS_TIFF, 'XResolution', newRes+"/1");
                          var ResY = xmp.setProperty( XMPConst.NS_TIFF, 'YResolution', newRes+"/1");
                          var PerInch = xmp.setProperty( XMPConst.NS_TIFF, 'ResolutionUnit',2); //Pixels per inch
                          var newPacket = xmp.serialize(XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
                          thumb.metadata = new Metadata(newPacket);
                          unloadXMPLib();
                    }catch(e){ alert(e); unloadXMPLib();}
                function loadXMPLib(){
                if (ExternalObject.AdobeXMPScript == undefined) {
                    ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
                 }
                }
                function unloadXMPLib(){ 
                   if( ExternalObject.AdobeXMPScript ) { 
                      try{ 
                         ExternalObject.AdobeXMPScript.unload(); 
                         ExternalObject.AdobeXMPScript = undefined; 
                      }catch (e){ } 
                   } 
                }
                
                

                 

                The cache will need to be purged to show the correct details though.

                • 5. Re: change resolution
                  Stephen_A_Marsh Adobe Community Professional

                  I know that Paul no longer visits these forums, however if anybody can get the script in post #4 to work that would be useful in the following topic:

                   

                  Re: Bridge 8.X update defaults to 72dpi