Skip to main content
Participant
May 13, 2017
Answered

Placement of logo action Inconsistent. What gives?

  • May 13, 2017
  • 1 reply
  • 575 views

I recently upgraded from CS5 to Adobe CC.  Few learning curves but I'm adjusting.  One thing I've run into is driving me crazy.

When I process photos to post online to my site, I always cropped (in CS5) my image to a 4x6, placed my logo in corner, flattened, resized, and saved.  Had a nice little action made up to do this to expidite my editing. (and yes, I had separate actions for a landscape or portrait image)

In CC...I recognize the whole cropping tool is a bit different but think I have it figured out.  My problem is after redoing a new action to  place or embed my logo, it never seems to end up in the same place or the same size.  It seems to vary depending on the way I crop my photo.  Really not sure what or why this is happening.

Any help or suggestions out there?

    This topic has been closed for replies.
    Correct answer TonyCorsoImages

    You did not answer my question are all image the same resolution and size  does your logo  have the same resolution as  your image.

    4x6 is  2:3 portrait aspect ratio indeed.  However there is a big difference in size between a 4x6 100DPI image and a 4x6 300DPI image. one has 240,000 pixels the other has 2,160,000 pixels. 

    It is tricky to handle image size with actions.  My action uses a little utility script I wrote in it process a couple of times.

    I have also posted a script to place logo on the bottom right of images.  The script resizes the logo to fit the image's size.

    #target photoshop; 

    app.bringToFront(); 

    var logoFile = "~/Desktop/JJMack.png"; // Watermark file should be large for resize down works better than up

    var LogoSize = 10; // percent of document height to resize Watermark to

    var LogoMargin = 1;                                         // percent of Document height the Watermark should have as a margin

    placeWatermark(logoFile, LogoSize, LogoMargin);             // Place Watermark  into the bottom right of document

    function placeWatermark(Image,Size,Margin){ 

      if(!documents.length) return;   // if no document return

      try{ 

      var doc = app.activeDocument; // set Doc object to active document

      app.displayDialogs = DialogModes.NO; // Dialog off

      var strtRulerUnits = app.preferences.rulerUnits; // Save Users ruler units

      var strtTypeUnits = app.preferences.typeUnits; // Save Users Type units

      app.preferences.rulerUnits = Units.PIXELS; // work with pixels

      app.preferences.typeUnits = TypeUnits.PIXELS; // work with pixels

      var fileObj = new File(Image);                 // the passed file

      if(!fileObj.exists){   // If file does not exits tell user

      alert(fileObj.name  + " does not exist!"); 

      return; 

      } 

      placeFile(fileObj); // Place in file the Watermark png file

      activeDocument.activeLayer.resize(100 ,100,AnchorPosition.MIDDLECENTER); // Insure Place did not scale layer 

      var SB = activeDocument.activeLayer.bounds; // get layers bounds

      var layerHeight = SB[3] - SB[1]; // get layers height 

      var resizePercent = (100/layerHeight)*(Size/100*doc.height.value); // Percent to resize by

      activeDocument.activeLayer.resize(resizePercent ,resizePercent,AnchorPosition.MIDDLECENTER);  // Resize width and height by percentage

      SB = activeDocument.activeLayer.bounds; // get resized layers bounds 

      activeDocument.activeLayer.translate(-SB[0].value,-SB[1].value); // Move resized layer to top left canvas corner

      var LayerWidth = (SB[2].value - SB[0].value); 

      var LayerHeight = (SB[3].value - SB[1].value); 

      marginSize = Margin/100*doc.height.value; // move resized watermark into the document lower right corner with some margin

      activeDocument.activeLayer.translate((doc.width.value -marginSize - LayerWidth),( doc.height.value -marginSize - LayerHeight));

      }

      catch(e) { alert(e + ': on line ' + e.line); } // inform user of error 

      finally{ 

      app.preferences.rulerUnits = strtRulerUnits; // Restore user ruler units 

      app.preferences.typeUnits = strtTypeUnits; // Restore user type units   

      }; 

    };

    function placeFile(placeFile) { 

        var desc21 = new ActionDescriptor(); 

        desc21.putPath( charIDToTypeID('null'), new File(placeFile) ); 

        desc21.putEnumerated( charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), charIDToTypeID('Qcsa') ); 

        var desc22 = new ActionDescriptor(); 

        desc22.putUnitDouble( charIDToTypeID('Hrzn'), charIDToTypeID('#Pxl'), 0.000000 ); 

        desc22.putUnitDouble( charIDToTypeID('Vrtc'), charIDToTypeID('#Pxl'), 0.000000 ); 

        desc21.putObject( charIDToTypeID('Ofst'), charIDToTypeID('Ofst'), desc22 ); 

        executeAction( charIDToTypeID('Plc '), desc21, DialogModes.NO ); 

    }; 


    Thank you so much for your insightful info provided here...  I did figure out what I was doing that fouled me up...had to do with the upgraded cropping tools in CC as compared to what I was using in CS5...and it was a resolution issue.  All fixed and I'm back in business.


    Thanks again

    1 reply

    JJMack
    Community Expert
    Community Expert
    May 13, 2017

    How does your action handle image with different resolutions that is tricky to do.  Are all your image the same size and resolution??? If not most action creators will have problems crafting an action to handle different resolution and size images.

    Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
    Contains

    Example
    Download

    JJMack
    Participant
    May 14, 2017

    Well the way I set this up....I edit my image, then crop at a 4x6 (or 2:3), then place the logo, flatten, reduce size of image, and save as copy.  That's the way I record the action to run AFTER I've cropped it.  So it doesn't make sense to me that when I edit another image in the same manner...that when I play the action...I see the logo placed in a slightly different place and in a different size.

    JJMack
    Community Expert
    Community Expert
    May 14, 2017

    You did not answer my question are all image the same resolution and size  does your logo  have the same resolution as  your image.

    4x6 is  2:3 portrait aspect ratio indeed.  However there is a big difference in size between a 4x6 100DPI image and a 4x6 300DPI image. one has 240,000 pixels the other has 2,160,000 pixels. 

    It is tricky to handle image size with actions.  My action uses a little utility script I wrote in it process a couple of times.

    I have also posted a script to place logo on the bottom right of images.  The script resizes the logo to fit the image's size.

    #target photoshop; 

    app.bringToFront(); 

    var logoFile = "~/Desktop/JJMack.png"; // Watermark file should be large for resize down works better than up

    var LogoSize = 10; // percent of document height to resize Watermark to

    var LogoMargin = 1;                                         // percent of Document height the Watermark should have as a margin

    placeWatermark(logoFile, LogoSize, LogoMargin);             // Place Watermark  into the bottom right of document

    function placeWatermark(Image,Size,Margin){ 

      if(!documents.length) return;   // if no document return

      try{ 

      var doc = app.activeDocument; // set Doc object to active document

      app.displayDialogs = DialogModes.NO; // Dialog off

      var strtRulerUnits = app.preferences.rulerUnits; // Save Users ruler units

      var strtTypeUnits = app.preferences.typeUnits; // Save Users Type units

      app.preferences.rulerUnits = Units.PIXELS; // work with pixels

      app.preferences.typeUnits = TypeUnits.PIXELS; // work with pixels

      var fileObj = new File(Image);                 // the passed file

      if(!fileObj.exists){   // If file does not exits tell user

      alert(fileObj.name  + " does not exist!"); 

      return; 

      } 

      placeFile(fileObj); // Place in file the Watermark png file

      activeDocument.activeLayer.resize(100 ,100,AnchorPosition.MIDDLECENTER); // Insure Place did not scale layer 

      var SB = activeDocument.activeLayer.bounds; // get layers bounds

      var layerHeight = SB[3] - SB[1]; // get layers height 

      var resizePercent = (100/layerHeight)*(Size/100*doc.height.value); // Percent to resize by

      activeDocument.activeLayer.resize(resizePercent ,resizePercent,AnchorPosition.MIDDLECENTER);  // Resize width and height by percentage

      SB = activeDocument.activeLayer.bounds; // get resized layers bounds 

      activeDocument.activeLayer.translate(-SB[0].value,-SB[1].value); // Move resized layer to top left canvas corner

      var LayerWidth = (SB[2].value - SB[0].value); 

      var LayerHeight = (SB[3].value - SB[1].value); 

      marginSize = Margin/100*doc.height.value; // move resized watermark into the document lower right corner with some margin

      activeDocument.activeLayer.translate((doc.width.value -marginSize - LayerWidth),( doc.height.value -marginSize - LayerHeight));

      }

      catch(e) { alert(e + ': on line ' + e.line); } // inform user of error 

      finally{ 

      app.preferences.rulerUnits = strtRulerUnits; // Restore user ruler units 

      app.preferences.typeUnits = strtTypeUnits; // Restore user type units   

      }; 

    };

    function placeFile(placeFile) { 

        var desc21 = new ActionDescriptor(); 

        desc21.putPath( charIDToTypeID('null'), new File(placeFile) ); 

        desc21.putEnumerated( charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), charIDToTypeID('Qcsa') ); 

        var desc22 = new ActionDescriptor(); 

        desc22.putUnitDouble( charIDToTypeID('Hrzn'), charIDToTypeID('#Pxl'), 0.000000 ); 

        desc22.putUnitDouble( charIDToTypeID('Vrtc'), charIDToTypeID('#Pxl'), 0.000000 ); 

        desc21.putObject( charIDToTypeID('Ofst'), charIDToTypeID('Ofst'), desc22 ); 

        executeAction( charIDToTypeID('Plc '), desc21, DialogModes.NO ); 

    }; 

    JJMack