The blog post yesterday about getting attachments out of Survey123 with the survey got me thinking. I have some older surveys with signature images as Attachments to the survey, but not associated with the signature questions in the survey.
Is there a way to repair these surveys in Survey123? To move the attached images from the survey to a specific survey question?
Thanks,
Clay
Solved! Go to Solution.
Hello @CBarrett,
Attachments are associated with image questions through attachment keywords.
The keyword is going to be the name of the image question in your XLSForm. We do have a Python notebook that assists with updating keywords on attachments.
Even though the notebook mentions that it's for ArcGIS Enterprise the workflow will also work with ArcGIS Online as well.
Hello @CBarrett,
Attachments are associated with image questions through attachment keywords.
The keyword is going to be the name of the image question in your XLSForm. We do have a Python notebook that assists with updating keywords on attachments.
Even though the notebook mentions that it's for ArcGIS Enterprise the workflow will also work with ArcGIS Online as well.
This looks perfect @ZacharySutherby.
Any chance you have another handy notebook that will fix the black borders issues from signature JPGs?
Hello @CBarrett,
I don't have an explicit full workflow, but from some quick testing there looks to be a Python module called Pillow that ships with ArcGIS Pro by default and can be used to crop the images.
I had tested the copping workflow from this article against the image posted in this Esri Community article and it seemed to work well.
The code that I had used was:
from PIL import Image
img = Image.open(r"C:\temp\signature.jpeg")
width, height = img.size
area = (0,0, width/2, height/2)
img = img.crop(area)
img.save(r"C:\temp\cropped_signature.jpeg"
The crop area may be different for your specific images.
If you download all your attachments you could crop the ones that need to be cropped and then update the attachments in your feature service using the Python API.