Z.Photos (Portico/Z v0.1.0)
Context for tasks related to Photos.
See the ID Photo Process guide for more details.
Link to this section Summary
Functions
Get photo info from the database
Convert a Cloudinary resource to EXPLO's preferred photo ID transformation.
Upload a photo file to the database
Link to this section Functions
Link to this function
get_photo(id)
Get photo info from the database
Link to this function
transformation_url(resource_id, type)
Specs
Convert a Cloudinary resource to EXPLO's preferred photo ID transformation.
Possible transformation options are:
face_center
- Center on the face, the defaultrotate_left
- 90 degree counterclockwise rotationrotate_right
- 90-degree clockwise rotationv_flip
- Vertical flipzoom_out
- Zoom out a bitzoom_in
- Zoom in a bit
Returns a URL referencing a PNG image.
Examples
iex> Z.Photos.transformation_url("sample", "face_center")
"https://res.cloudinary.com/explo/image/upload/c_thumb,e_improve,g_face:center,h_300,q_auto:good,r_max,w_300,z_0.8/sample.png"
iex> Z.Photos.transformation_url("sample", "zoom_out")
"https://res.cloudinary.com/explo/image/upload/c_thumb,e_improve,g_face,h_300,q_auto:good,r_max,w_300,z_0.6/sample.png"
iex> Z.Photos.transformation_url("sample", "rotate_left")
"https://res.cloudinary.com/explo/image/upload/a_-90,c_thumb,e_improve,g_face,h_300,q_auto:good,r_max,w_300,z_0.8/sample.png"
iex> Z.Photos.transformation_url("sample", "none")
"https://res.cloudinary.com/explo/image/upload/c_thumb,e_improve,g_face,h_300,q_auto:good,r_max,w_300,z_0.8/sample.png"
Link to this function
upload(file_path, options \\ %{})
Upload a photo file to the database
For details about options, see Library.Cloudinary.upload_file/2