Mobile Backend Services provides a great amount of flexibility when creating photo objects or adding photos to other objects.
Custom photo sizes
App developers can specify a custom set of photo sizes by specifying the
photo_sizes[<name>]=<width>x<height> parameter up to five times, such as:
To specify a size that results in a square image, give the same width and height along with a
# immediately after, as shown above.
You may specify the
photo_sizes parameter when creating or updating a Photos object or when adding a photo with the Users or Places create or update method.
The resized images are generated asynchronously, so the API or SDK call returns immediately with a response showing photo metadata:
Note that in the above response
processed=false. This indicates that the photo is still processing in the background. Once the photo has been processed, the
processed flag will be set to
true and the URLs to access the photo are shown:
Synchronous photo uploading
You can also specify photo sizes to be processed synchronously during the create or update calls for photos and other objects with attached photos. This can be useful for immediately showing a thumbnail of the photo that was just uploaded. Specify
photo_sync_sizes=<size name> one or more times in the request. The response will contain URLs for the original photo, plus the size or sizes which were processed synchronously. The property
processed will be
false until all processing has been completed. This feature may be used with either the default photo sizes or custom photo sizes.
After processing, all photo sizes will be available and
processed=true will be set.
ACS applications used to create the following default photo sizes when a photo was created:
|Size Name||Max Width||Max Height||Aspect Ratio|