Image methods

The SharinPix package provides the Apex class, Image , which includes methods that can be applied when manipulating images on Salesforce.

Methods:

  • moveImages

  • exportAsContentDocument

  • downloadImages

  • fetchAsBase64

  • restoreImage

Image Method Example

moveImages

global static List moveImages(List lstImageIds, String destinationAlbumId)Moves one or more images to another album. Note: This method can be used to move a maximun of 50 images at once. Example: sharinpix.Image.moveImages(new List<String> { 'imageId1', 'imageId2' }, 'destinationAlbumId');exportAsContentDocumentglobal voidexportAsContentDocument()Exports a SharinPix Image to Salesforce as a Content Document. Example: (new sharinpix.Image('public_id')).exportAsContentDocument();downloadImagesglobal static StringdownloadImages(List imageIds)Get a URL that opens a zip including the images. Example: sharinpix.Utils u = new Sharinpix.Utils(); sharinpix.Image.downloadImages(u.getAlbumImageIds(albumId));fetchAsBase64global static StringfetchAsBase64(String url)Converts an image to base64. Example: sharinpix.Image.fetchAsBase64('https://app.sharinpix.com/image.png');restoreImageglobal static StringrestoreImage(String imageId)Restores a trashed SharinPix Image. Example: sharinpix.Image.restoreImage('imageId');Tip:The SharinPix package also includes the **Utils **class, which provides useful methods that can be used for image, album, tag management, and a lot more. For more information about the **Utils **method, please refer to the article below:Utils methods

Last updated