發表文章

目前顯示的是 六月, 2014的文章

PhotoShop RAW to JPEG Using RUBY + VBA

不囉嗦,以下是程式碼

#encoding: UTF-8require 'win32ole'ps = WIN32OLE.new("Photoshop.Application")ps.Preferences.RulerUnits = 1ps.Preferences.TypeUnits = 1jpeg = WIN32OLE.new("Photoshop.JPEGSaveOptions")jpeg.Quality = 12ps.Load("C:\\ps_test\\_MG_5751.CR2")doc = ps.Documents.Item(1)w = doc.widthh = doc.heightif( w >= h )    doc.ResizeImage(1800,nil,nil,7)else    doc.ResizeImage(nil,1800,nil,7)enddoc.SaveAs("C:\\ps_test\\_MG_5751.jpg",jpeg)doc.closeps.quit


參考手冊

http://www.adobe.com/devnet/photoshop/scripting.html