利用Photoshop自动给图片添加EXIF信息并缩图.doc_第1页
利用Photoshop自动给图片添加EXIF信息并缩图.doc_第2页
利用Photoshop自动给图片添加EXIF信息并缩图.doc_第3页
利用Photoshop自动给图片添加EXIF信息并缩图.doc_第4页
利用Photoshop自动给图片添加EXIF信息并缩图.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

利用photoshop自动给图片添加exif信息并缩图 在网上看到很多人的相片上都有作者信息、相机型号、光圈、快门、iso什么的,觉得很是专业,感觉很是羡慕。以前用光影魔术手这个软件可以轻松实现,现在突然想用photoshop 来实现这个功能,这么强大的软件我想肯定也有办法来实现的。临渊羡鱼,不如退而结网,到baidu上搜索了一下,找到好些关于这方面的文章,专门介绍如何用photoshop cs提取照片的exif信息,自动生成加上信息的pp,感觉真是酷。于是照葫芦画瓢,我试验成功了,并且对原来的方法进行了下修改,在此也跟大家分享一下。 好了,废话少说,下面正式开始干活。在photoshop中很难给图片直接加上照片的exif信息,这里给你提供了一个自动添加照片exif信息的脚本文件. 请将两条“-”横线之间的内容拷贝下来,放在记事本里面,文件名另存成xxxx.jsx,然后打开photoshop,打开一张数码照片,点击【文件】【脚本】【浏览】,找到你刚才存的jsx文件,【载入】,photoshop会运算一段时间,运行完成后就可以看到照片已经给添加好exif信息了。 你也可以把jsx脚本存在以下目录“c:program filesadobeadobe photoshop cs5presetsscripts”(不同操作系统、ps版本会略有不同),以后就会显示在脚本菜单里,方便使用。/使用photoshop脚本自动添加exif信息并缩图(黑框)displaydialogs = dialogmodes.no; var defaultrulerunits = preferences.rulerunits; preferences.rulerunits = units.pixels; function explodearray(item) var i=0;var count=0; var tempstring=new string(item); temparray=new array(1); do i=tempstring.indexof(:);if(i0)tempstring=tempstring.substr(i+1,tempstring.length-i-1);i=tempstring.indexof();if(i0) temparraycount=tempstring.substr(0,i); tempstring=tempstring.substr(i+1,tempstring.length-i-1);count +;i=tempstring.indexof(0) temparraycount=tempstring.substr(0,i); tempstring=tempstring.substr(i-1,tempstring.length-i+1);count +;while (tempstring.indexof()0);temparraycount=tempstring; return temparray; var i=0;var j=0;var k=0;var presulotion=72;var ad=;var resratio=;var imageratio=;var datearray1=;var datearray2=;var monthsarray=;var exposureprogramarray=;var phodate=;var photime=;var photowidth=;var photohight=;var exifdata=;var black=; var white=; var grey=;var fwidth=;var fhight=;var tsize=;var tleft=;var thight=;var infolayer=;var ti=;namelayer=; var tn=; var stringtemp=;var make=;var model=;var camera=;var lens=;var lensused=;var focallength=;var exposuretime=; var fnumber=;var isospeedratings=;var datetimeoriginal=;var exposurebiasvalue=;var exposureprogram=;var fired=; var creator=photo by june;ad = activedocument; var resizemax=1200; /添加exif后的图片大小-宽度var resizemin=800; /添加exif后的图片大小-高度if(ad.width.value 1200 | ad.height.value 1200) imageratio = ad.width.value/ad.height.value;if(imageratio1)ad.resizeimage(resizemax,resizemin,presulotion,resamplemethod.bicubicsharper); if(imageratio=1)ad.resizeimage(resizemax,resizemax,presulotion,resamplemethod.bicubicsharper); if(imageratio1)ad.resizeimage(resizemin,resizemax,presulotion,resamplemethod.bicubicsharper); resratio = ad.resolution/presulotion; if(resratio!=1) ad.resizeimage(ad.width.value,ad.height.value,presulotion); photowidth = ad.width.value; photohight = ad.height.value; exifdata = ad.xmpmetadata.rawdata.tostring();explodearray(exifdata); for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(exposuretime)!=-1) exposuretime = temparrayn+1; break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(fnumber)!=-1) fnumber = temparrayn+1;break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(exposureprogram)!=-1) exposureprogram = temparrayn+1; break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(exposurebiasvalue)!=-1) exposurebiasvalue = temparrayn+1; break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(fired)!=-1) fired = temparrayn+1; break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(datetimeoriginal)!=-1) datetimeoriginal = temparrayn+1; break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(temparrayn=focallength) focallength = temparrayn+1;break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(isospeedratings)!=-1) isospeedratings = iso +temparrayn+5; break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(temparrayn=lens) lens=temparrayn+1; break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(make)!=-1) make = temparrayn+1; break; for(n = 0; n temparray.length; n +) stringtemp=temparrayn;if(stringtemp.indexof(model)!=-1) var model = temparrayn+1; break; camera = model; for(n = 0; n 1)fnumber=i/j;elsefnumber=i;datearray1 = exposurebiasvalue.split(/);i = datearray10;j = datearray11;exposurebiasvalue=i/j;if(exposurebiasvalue!=0)exposurebiasvalue=parseint(exposurebiasvalue*100)/100;if (exposurebiasvalue 0)exposurebiasvalue=+exposurebiasvalue;exposureprogramarray = not defined,manual,normal program,aperture priority,shutter priority,creative program,action program,portrait mode,landscape mode;exposureprogram = exposureprogramarrayexposureprogram;datearray1 = fired;if(datearray1.indexof(true)!=-1)fired=flashon;elsefired=flashoff;datearray1 = focallength.split(/);i = datearray10;j = datearray11;if(j1)focallength=parseint(i/j);elsefocallength=i;datearray1 = datetimeoriginal.split(t); phodate = datearray10;photime = datearray11;datearray2 = phodate.split(-); monthsarray =january, february, march, april, may,june, july, august, september, october, november, december; datearray2 = photime.split(+);photime = datearray20;if(lens != ) if(lens.indexof(15.0-85.0 mm)!=-1)lensused = canon 15-85mm f/3.5-5.6 is usm; if(lens.indexof(70.0-200.0 mm)!=-1)lensused = canon 70-200mm f4l usm;if(lens.indexof(85.0 mm)!=-1)lensused = canon 85mm f1.8 usm; if(lens.indexof(50mm)!=-1)lens = sigma af 50/1.4 ex dg hsm; else var foclength=parseint(focallength);if(foclength=15 & foclength=70 & foclength=200)lensused = canon 70-200mm f4l usm;if(foclength=85)lensused = canon 85mm f1.8 usm; if(foclength=100)lensused = canon macro 100mm f2.8 usm; black = new solidcolor(); black.rgb.red = black.rgb.green = black.rgb.blue = 255; white = new solidcolor(); white.rgb.red = white.rgb.green = white.rgb.blue = 0; grey = new solidcolor(); grey.rgb.red = grey.rgb.green = grey.rgb.blue = 50; backgroundcolor = black; ad.resizecanvas(ad.width.value+2,ad.height.value+2,anchorposition.middlecenter); backgroundcolor = white; fwidth = parseint(photowidth/40); /exif信息栏宽度fhight = parseint(photowidth/30); /exif信息栏高度ad.resizecanvas(ad.width.value+fwidth/2,ad.height.value+fhight/2, anchorposition.middlecenter); ad.resizecanvas(ad.width.value,ad.height.value+fhight*1.5,anchorposition.topcenter); namelayer = ad.artlayers.add(); namelayer.kind = layerkind.text; tn = namelayer.textitem; tn.contents = creator;tn.font = stxingkai; /作者信息字体设置,可更改tn.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论