Batch Resize Image Attachements in ArcGIS Server

1546
3
02-06-2017 04:31 PM
Status: Open
MatthewBradbury
New Contributor III

This feature would enable administrators to quickly resize a feature classes's image attachments that do not meet the maximum image dimensions or file size, or file format. This would be very helpful when looking to reduce the size of geodatabases with lots of over-sized image attachments from apps such as Collector. It would also be helpful if apps such as collector could automatically resize images, change them to a desired format, and set the compression level.

3 Comments
roemhildtg

You could do this with a nightly python script.

RandyBonds_Jr_

Do you happen to have a python script to do this? It's something I'm super interested in.

roemhildtg

I don't have a script that does this but I'd start with something like this:

GitHub - charlesthk/python-resize-image: A Small python package to easily resize images 

from PIL import Image

from resizeimage import resizeimage


with open('test-image.jpeg', 'r+b') as f:
    with Image.open(f) as image:
        cover = resizeimage.resize_cover(image, [200, 100])
        cover.save('test-image-cover.jpeg', image.format)‍‍‍‍‍‍‍‍‍

maybe combine that with 

arcgis.features.managers module — arcgis 1.5.0 documentation