[分享] 4:3照片加長成135比例附上時間的PS script

看板PhotoEdit作者 (OOOOOOOOOOOOOOOOOOOOOOO)時間14年前 (2010/11/16 17:20), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
※ [本文轉錄自 DSLR 看板 #1CuaarVC ] 作者: pingupingu (OOOOOOOOOOOOOOOOOOOOOOO) 看板: DSLR 標題: [分享] 4:3照片加長成135比例附上時間的PS script 時間: Tue Nov 16 17:04:50 2010 網誌版....->http://imhappypingu.blogspot.com/2010/11/ps-javascript-43135.html 為啥4/3用戶或是DC用戶拍照都只有4.5X6的選擇才能滿版阿!! 只好弄一個script來改一下尺寸 順便利用空白處加上日期吧!! 完成的效果如底下範例圖 http://0rz.tw/eYuJG (註:script主要參考這作者的作品來修改:http://0rz.tw/wqTNo) 請取用下方script或自網誌下載 請大家依排版喜號自行修改使用 // JavaScript Document // "P_43to135addDateTime.js" // 2010/11/16 // reference: http://hk.rd.yahoo.com/blog/mod/art_title/*http://hk.myblog.yahoo.com/vulcanpang/article?mid=1238 // Contact: pingu65@gmail.com //--------------------------------------START HERE---------------------------------------------------------------- // Default setting displayDialogs = DialogModes.NO; var defaultRulerUnits = preferences.rulerUnits; preferences.rulerUnits = Units.PIXELS; //function define function explodeArray(item,delimiter) { tempArray=new Array(1); var Count=0; var tempString=new String(item); while (tempString.indexOf(delimiter)>0) { tempArray[Count]=tempString.substr(0,tempString.indexOf(delimiter)); tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1); Count=Count+1 } tempArray[Count]=tempString; return tempArray; } // Load image var AD = activeDocument; if (AD.height > AD.width) AD.rotateCanvas(90); // vertical image adjustment var resRatio = AD.resolution/314; if(resRatio!=1){ AD.resizeImage(AD.width.value,AD.height.value,314); } // Read EXIF content var exifData = AD.info.exif.toString(); explodeArray(exifData,","); // Find out DateTime info var dateTime=""; 胣肀 for(n = 0; n < tempArray.length; n ++) 胣肀 { 胣肀 stringTemp = tempArray[n]; 胣肀 if(stringTemp.indexOf("Date Time Original") != -1) 胣肀 { 胣肀 dateTime= tempArray[n+1]; 胣肀 break; 胣肀 } 胣肀 } // Reconstruct Time & Date array var dateArray1 = dateTime.split(" "); var phoDate = dateArray1[0]; var phoTime = dateArray1[1]; var dateArray2 = phoDate.split(":"); var dateArray3 = phoTime.split(":"); // Resize image to 135 frame ratio backgroundColor.rgb.red = 0; backgroundColor.rgb.green = 0; backgroundColor.rgb.blue = 0; var heightVar = AD.height.value var photoWidth = AD.width.value; AD.resizeCanvas(AD.height.value*1.5,AD.height.value, AnchorPosition.MIDDLELEFT); // or TOPCENTER, MIDDLECENTER... // Add Time Date text var PRatio = heightVar/2736; // Based on 2736 pixels/height image // Add new text layer : date var infoLayer = AD.artLayers.add(); infoLayer.kind = LayerKind.TEXT; var TI = infoLayer.textItem; TI.justification = Justification.CENTER; // align center TI.position = [(photoWidth+AD.width.value)/2,heightVar-200*PRatio]; // push in the mid of the dark bar TI.contents = dateArray2[0]-1911+" "+dateArray2[1]+" "+dateArray2[2]; TI.font = "Courier"; TI.size = 16*PRatio; TI.color.rgb.red = 255; TI.color.rgb.green = 255; TI.color.rgb.blue = 255; TI.antiAliasMethod = AntiAlias.NONE; //TI.fauxBold = true; // bold font // Add new text layer : time var infoLayer = AD.artLayers.add(); infoLayer.kind = LayerKind.TEXT; var TI = infoLayer.textItem; TI.justification = Justification.CENTER; TI.position = [(photoWidth+AD.width.value)/2,heightVar-60*PRatio]; TI.contents = dateArray3[0]+" "+dateArray3[1]+" "+dateArray3[2]; TI.font = "Courier"; TI.size = 16*PRatio; TI.color.rgb.red = 255; TI.color.rgb.green = 255; TI.color.rgb.blue = 255; TI.antiAliasMethod = AntiAlias.NONE; //TI.fauxBold = true; AD.flatten(); // flatten image // -------------------------------End of this script..........--------------------------- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.165.173.113 ※ 編輯: pingupingu 來自: 118.165.173.113 (11/16 17:06)

11/16 17:13,
APS-C用4X6也是會被裁到 4.5X6才會正確顯示
11/16 17:13

11/16 17:16,
可是nikon的APS-C比例是2:3阿~~
11/16 17:16

11/16 17:17,
原來是這樣喔..那就想用的人就自己改改吧XD
11/16 17:17
-- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.165.173.113

11/20 09:03, , 1F
讚,雖用不到還是大推
11/20 09:03, 1F

11/24 23:23, , 2F
謝謝你!
11/24 23:23, 2F
文章代碼(AID): #1CuapwAX (PhotoEdit)
文章代碼(AID): #1CuapwAX (PhotoEdit)