2 Replies Latest reply on Nov 19, 2014 3:12 PM by Powell

    place image from canvas

    Powell

      Good morning!

      I am tasked with adding some functionality to allow uses to create a brand compliant group image to the group create page, trying to do as much of this clientside as I can.

      Really just adding user provided text to a box with a specific grandient. 

      My flow is like this:

      -user clicks 'create avatar'

      -pop up window with form with elements for the text to apply to the image

      -user enters text, use canvas to draw the desired image + text, 

      -user clicks ok

      -image on preview updates to show new image

      -on save of group, group created with the users image as the avatar

       

      1. What is the best way to upload a group image?

      *I will be inside the interface, so I am assuming I can leverage v2 endpoints?

      I see that the create a group page avatar function after user has selected his image, and uploaded it,

      calls

      __services/v2/rest/places/avatar/tempimg 

      then

      __services/v2/rest/places/avatar/tempimg?filename=tempImage7216762078152672790.bin
      What is this doing?  How is this temporary image handled when the group is actually created?

      *It seems like it creates a real image, and assigns it to the group after the place is made using this:

      /__services/v2/rest/places/avatar/create?filename=tempImage6680135378884318081.bin&placeID=750650

       

      2. Can a place avatar be uploaded using multi part formdata or json base64 string ?
      I am hoping I can do a toDataURL() to turn my canvas to an image and provide that to the ajax call to to some endpoint.

      Seems like it would be possible, having trouble finding the right documentation for that.

       

       

      Any help at all greatly appreciated!

       

      Thanks,

      Powell