Would you like to contribute to the Titanium docs? To get started, sign up for an account on the Appcelerator Wiki and sign our CLA.

Skip to end of metadata
Go to start of metadata

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:

 Expand source

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:

 Expand source

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.

 Expand source

After processing, all photo sizes will be available and processed=true will be set.

 Expand source

Deprecated behavior

ACS applications used to create the following default photo sizes when a photo was created:

Size NameMax WidthMax HeightAspect Ratio
square_757575square
thumb_10010067original
small_240240160original
medium_500500333original
medium_640640427original
large_10241024683original