I need to use attached photos in other applications. The come without exif information and the name is some cryptic number. Is there a wasy to influence the name, prefereably to reflect date and time.

3009
3
04-15-2016 12:56 AM
BGSWasser
New Contributor II

Attachments (photos) ar needed to go in dokumentation outside ArcGIS. It would be good to sort  and identify them easily, but the filename is quite a long number and there is no EXIF information. Therefore I would like to set a style for the atachment file-name like jjmmddhhmm. Is there a way to do that?

Tags (2)
0 Kudos
3 Replies
NeilAyres
MVP Alum

I had to get the time stamp of some photos a while ago.

I used python os.stat.

It would be fairly easy to modify this code to rename the photo file..

My original just wrote out to text.

for fname in flist:
  for ext in extension:
    if fname.endswith(ext):
      f = os.path.join(impath, fname)
      st = os.stat(f)
      dt = time.strftime('%d/%m/%Y %H:%M:%S', time.localtime(st[8]))
      outstr = fname + '  ' + dt + '\n'
      outfd.write(outstr)
outfd.close()
0 Kudos
TravisSmith1
New Contributor III

Unfortunately, you cannot do this directly in Collector (this needs to change). You can, however, follow some steps to rename attachments in ArcMap after you've downloaded the data.

1) Bring features and related attachment table into ArcMap

2) Join the attachment table to the features using the GLOBALID and REL_GLOBALID fields

3) Now you can re-calculate the the ATT_NAME to whatever field value you have in your features table (an ID for example, or date/time, etc.). Make sure to add ".jpg" or whatever image extension you use so they export correctly.

4) Then batch export attachments from the feature class

- found here 41763 - Batch export attachments from a feature class

It will export all attachments in the attachment table to a specified folder location given the ATT_NAME + extension you use....for example: 12345.jpg

0 Kudos
DougMorgenthaler
Esri Regular Contributor

As part of the upcoming Collector 10.4 release we will be maintaining EXIF information for photos added via Collector. Realize this isn't the only aspect you're interested in or have commented on, but wanted to alert you to this upcoming change.

-Doug