Sunday 26 March 2017

python - Watermarking photos using geotag and creating shapefile from coordinates?


I have geotagged photographs and I would like to place a watermark of the photos location on the front for easy reference as well as creating a shapefile from the coordinates.


Does anyone know of any open source software which could do this?



This link is an example of what Iam trying to acheive



Answer



you can use python for getting EXIF info:


from PIL import Image
from PIL.ExifTags import TAGS
from pprint import pprint

def getexif(im):
res = {}
try:

img = Image.open(im)
info = img._getexif()
for tag, val in info.items():
dec = TAGS.get(tag, tag)
res[dec] = val

except IOError:
print im
return res
pprint res


then use python ImageDraw module for drawing text or anything.


import ImageFont, ImageDraw

def drawtext(im):
op = ImageDraw.Draw(im)
fnt = ImageFont.truetype("tahoma.ttf", 12)
op.text((5, 5), "YourText", font=fnt)

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...