0

我有一个文件夹(ProjectA),其中包含多个文件夹(Pano1、Pano2、Pano3...),每个文件夹包含 2 个图像(Left1 和 right1、left2 和 right2、left3 和 right3...)。

我在 Photoshop 中使用脚本在 ProjectA 中的每个“Pano”文件夹上运行 photomerge。

它曾经完美地运行,它将在 photomerge 中打开 Left1,然后是 Right1,并处理全景图。总是向左,然后向右。

现在安装 High Sierra 后,我正在使用的 SSD 已将文件格式更改为 APFS。现在它有时会先使用 Right1,然后再使用 Left1,从而导致生成的全景图与先使用 Left1 然后使用 Right1 的情况不同。它首先选择左或右的方式似乎不是随机的,但我无法理解它使用的逻辑。

我知道是 APFS 导致了这个问题,因为如果我将 ProjectA 放在 HFS+ 硬盘中,脚本运行完美。

这是我使用的脚本,任何帮助将不胜感激!

var runphotomergeFromScript = true; // must be before Photomerge include 
//@includepath /Applications/Adobe Photoshop CS6/Presets/Scripts/
//@include "Photomerge.jsx"
//@show include 

psdOpts = new PhotoshopSaveOptions(); 
psdOpts.embedColorProfile = true; 
psdOpts.alphaChannels = true; 
psdOpts.layers = true; 

var jpegOptions = new JPEGSaveOptions();
jpegOptions.quality=12;
jpegOptions.scans=5;

var workFolder = Folder.selectDialog(); 
var folders = workFolder.getFiles( function( file ) { return file instanceof Folder; } ); 

for( var i = 0; i < folders.length; i++ ) 
{   
var folder = folders[i]; 
var fList = folder.getFiles( '*.jpg' );

   // override Photomerge.jsx settings. Default is "Auto". Uncomment to override the default. 
   //photomerge.alignmentKey   = "Auto"; 
   photomerge.alignmentKey   = "Prsp"; 
   //photomerge.alignmentKey   = "cylindrical"; 
   //photomerge.alignmentKey   = "spherical"; 
   //photomerge.alignmentKey   = "sceneCollage"; 
   //photomerge.alignmentKey   = "translation"; // "Reposition" in layout dialog    

   // other setting that may need to be changed. Defaults below 
   photomerge.advancedBlending      = true; // 'Bend Images Together' checkbox in dialog 
   photomerge.lensCorrection      = false; // Geometric Distortion Correction'checkbox in dialog 
   photomerge.removeVignette      = false; // 'Vignette Removal' checkbox in dialog 

   if( fList.length > 1 )
   {
   photomerge.createPanorama(fList,false); 
   } 

   // The merged doc will be the activeDocument 
   // activeDocument.saveAs( new File( fList[0].parent + '/Stitch.psb' ) , psdOpts, true, Extension.LOWERCASE); 

//   try to always save as psb for larger files
activeDocument.saveAs( new File( fList[0].parent + '.jpg' ) , jpegOptions, true, Extension.LOWERCASE);  
activeDocument.close( SaveOptions.DONOTSAVECHANGES ); 
}

function savePSB(fileNameAndPath)
{
function cTID(s) { return app.charIDToTypeID(s); };
function sTID(s) { return app.stringIDToTypeID(s); };

var desc19 = new ActionDescriptor();
 var desc20 = new ActionDescriptor();
desc20.putBoolean( sTID('maximizeCompatibility'), true );
desc19.putObject( cTID('As  '), cTID('Pht8'), desc20 );
desc19.putPath( cTID('In  '), new File( fileNameAndPath ) );
desc19.putBoolean( cTID('LwCs'), true );
executeAction( cTID('save'), desc19, DialogModes.NO );
};
4

0 回答 0