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

Action for placing logo not working

Community Beginner ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

For the wedding photography side of our business,  I've made actions that place our logo on the photo (two actions, one each for vertical/horizontal photos, all 4x6 ratio), and then size for the web so I can upload them to our blog.  My actions made last year were working just fine until just recently when I went to use them yesterday, when the logo started being placed in the incorrect spot on the photos, both for my vertical and horizontal photo actions.  I made new actions yesterday, and now the logo is being placed at random on the photos, or not at all.  In my action, after I place the logo, I flatten the image before I size it and save for web.  Basically the same steps I've done in the past that have worked.  So, I guess my question is two-fold.  Why did my actions that previously worked perfectly stop working, and why can't I create a new action that works?  My photoshop version is 22.0.1 and my computer is a Mac running Catalina 10.15.6.

Views

500

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Beginner , Jan 19, 2021 Jan 19, 2021

Sooo....it would appear that I needed to size my image before placing the logo since each image was a slightly different size, even though they were all a 4x6 ratio.  I made new actions where I sized, then placed, then flattened, then exported for web, and lo and behold, I'm back in business.  I still don't have an answer as to why my previous actions stopped working, but I'm ok with that since I solved my current issue.  Thanks to Stephen and John for weighing in.  

Votes

Translate

Translate
Adobe
Community Expert ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

Please post a cropped screenshot of the action set and actions with all steps expanded so that the recorded options are visible.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

Screen Shot 2021-01-19 at 3.06.27 PM.pngScreen Shot 2021-01-19 at 3.06.56 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

You could use a script to place your logo on any size Image sized appropriately for the image's size and positioned  where you want it. One script for all image sizes.

/* ==========================================================
// 2021  John J. McAssey (JJMack) 
// ======================================================= */
// This script is supplied as is. It is provided as freeware. 
// The author accepts no liability for any problems arising from its use.
/*
<javascriptresource>
<about>$$$/JavaScripts/PlaceLogo/About=JJMack's PlaceLogo ^r^rCopyright 2021 Mouseprints.net^r^rPhotoshop Script^rCustomize using first four var</about>
<category>JJMack's Script</category>
<enableinfo>true</enableinfo>
</javascriptresource>
*/
#target photoshop;  
app.bringToFront();  
var logoFile = "~/Desktop/JJMack.png";						// Logo Image file should be large for resize down works better than up. Vector files can be any size.
var LogoSize = 10;											// percent of document height to resize Logo to
var LogoMargin = 1;                                         // percent of Document height the Logo should have as a margin
var LogoLocation = 9;										// Like a tick tack toe board 1 through 9.  1=Top Left 9=Bottom Right
var LogoRotation = -20;										// Center Logo Location 5 can be Rotated -90 through +90 degrees  + degree Clockwise - CounterClockwise

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 
//placeLogo(logoFile, LogoSize, LogoMargin, LogoLocation, LogoRotation); // Place Logo into the location 5 would be Document's center
if (documents.length) app.activeDocument.suspendHistory('placeLogo','placeLogo(logoFile,LogoSize,LogoMargin, LogoLocation, LogoRotation)' );
app.preferences.rulerUnits = strtRulerUnits;		// Restore user ruler units  
app.preferences.typeUnits = strtTypeUnits;			// Restore user type units    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function placeLogo(Image,Size,Margin,position,angle){  
	if(!documents.length) return;  							// if no document return
	var fileObj = new File(Image);	 		               	// the passed file
	if(!fileObj.exists){  									// If file does not exits tell user 
		alert(fileObj.name  + " does not exist!"); 			// Alert User 
		return;  											// return
	}  
	try{  
		var doc = app.activeDocument;						// set Doc object to active document
		var layers = app.activeDocument.layers;				// get layers
		app.activeDocument.activeLayer = layers[0];			// Target Top Layer
		placeFile(fileObj); 								// Place in file the Logo 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 
		marginSize = Margin/100*doc.height.value;			// Margin size
		var selectedRegion = Array(Array(0+marginSize,0+marginSize), Array(doc.width-marginSize,0+marginSize), Array(doc.width-marginSize,doc.height-marginSize), Array(0+marginSize,doc.height-marginSize));
		activeDocument.selection.select(selectedRegion);    // Select  document area for the logo Positioning
		switch (position){									// Align resized logo smart object layer into position
			case 1 : align('AdLf'); align('AdTp'); break;
			case 2 : align('AdCH'); align('AdTp'); break;
			case 3 : align('AdRg'); align('AdTp'); break;
			case 4 : align('AdLf'); align('AdCV'); break;
			case 5 : align('AdCH'); align('AdCV'); activeDocument.selection.deselect(); activeDocument.activeLayer.rotate(angle); break;
			case 6 : align('AdRg'); align('AdCV'); break;
			case 7 : align('AdLf'); align('AdBt'); break;
			case 8 : align('AdCH'); align('AdBt'); break;
			case 9 : align('AdRg'); align('AdBt'); break;
			default : break;
		}
		app.activeDocument.selection.deselect();			// deselect
	}
	catch(e) { alert(e + ': on line ' + e.line); }			// inform user of error  
	finally{ }  
} 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
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 );  
} 

function align(method) {
	var desc = new ActionDescriptor();
	var ref = new ActionReference();
	ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
	desc.putReference( charIDToTypeID( "null" ), ref );
	desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
	try{
		executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );
	}catch(e){}
}

 

 

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

Thanks so much for the reply!  I am not familiar with placing scripts, so I am unsure how I would go about this?  I usually use the action/s to place logos and save for web on about 50 images at a time for a blog post, so am wondering if this can be automated the same way, or used in an action?  I am tech savvy to the degree needed to do my job, and when I reach a point of finding out I don't know how to do something, then I try to learn it.  :). Based on what I see, I feel that this option might require more knowledge than I possess.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

Sooo....it would appear that I needed to size my image before placing the logo since each image was a slightly different size, even though they were all a 4x6 ratio.  I made new actions where I sized, then placed, then flattened, then exported for web, and lo and behold, I'm back in business.  I still don't have an answer as to why my previous actions stopped working, but I'm ok with that since I solved my current issue.  Thanks to Stephen and John for weighing in.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

LATEST

Yes actions have steps that have been recorded  on a particular size image.  Steps setting are not changed for different size images. That requires the use of Scripting so you  can program in the logic required to process any size image. So the Script can resize your logo to be proportional to document size the logo is being placed into.

 

If an action uses Photoshop Place. Place may scale the logo to fit on canvas if your Photoshop preferences is set to resize during Place.  Place may scale the Placed image  when file's Print resolution setting is different  then the current document resolution resolution the action is played on place will scale the image.  Place is a strange beast.

JJMack

Votes

Translate

Translate

Report

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