Advertisement
Guest User

Untitled

a guest
May 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. # make sure you're in an edit session
  2. fields = [blob_field, file_name] #blob field is your blob field and file_name is the file name field
  3. with arcpy.da.UpdateCursor(attachments, fields) as rows:
  4. for r in rows:
  5. # save to jpg on disk for temp editing
  6. jpg = r'C:some_path_tosave{}'.format(r[1])
  7. data = open(jpg, wb).write(r[0].tobytes())
  8.  
  9. # do your step 1 with data
  10. # do your step 2 with data
  11.  
  12. # now you're ready to write it back in
  13. r[0] = open(jpg, 'rb').read()
  14. rows.updateRow(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement