SharinPix Transformation - get your images automatically resized!
Note:
This article assumes that SharinPix Image Sync has been activated.
Examples
The following examples will show to activate SharinPix Transformations and then perform an automatic resizing of your images !
- Fill to size
Create an image with the exact given width and height while retaining the original aspect ratio.
(height = width = 250 pixels) - for that example value was set to "250"
Fit to Size
The image is resized so that it takes up as much space as possible within a bounding box defined by the given width and height values. All of the original image remains visible after the resizing.
(height = width = 250 pixels) - for that example value was set to "250"
Pad to Size
Resize the image to fill the given width and height while retaining the original aspect ratio and with all of the original image visible.
(height = width = 250 pixels) - for that example value was set to "150"
- Scale to size
Change the size of the image exactly to the given width and height without necessarily retaining the original aspect ratio. (height = width = 150 pixels)
- Limit to size
Set the limit size of the image to the specified width and height. If the image dimensions exceed the specified value(s), the image is down scaled to match the same. Else the image dimensions are retained. In the example below, the Limit to size value has been set to 250 pixels (height=width = 250 pixels) and the original image size is 300x300. Therefore, the image has been down scaled to a height and width of 250 pixels.
Setup SharinPix Transformation
- The first step is to create a new field on the SharinPix Image Object, that will contain the URL towards the image that has been transformed/manipulated.
- Go to the Object Manager inside Setup, and select the SharinPix Image object.
- Select Fields & Relationships. Click on New.
- Select the field type of URL.
- Enter the field name of your choice and proceed to the next steps. The field label should ideally reflect the Image Transformation carried out on the image.
- Finally click on Save.
Transformations
Transformation: Fill to Size
Follow the above steps to create a field on the SharinPix Image Object. In this example, a field with label Fill to Size has been created on the SharinPix Image Object(1).
- Go to Setup, type Custom Metadata Types in the Quick Find Box (1). Select Manage Records right next to the SharinPix Transformation label(2).
- Click on the New button.
Fill in the values:
- In the Field name text input, enter the field API name that was created above in the SharinPix Image Object(1).
- Select SharinPix Sync Setting item that was previously selected in the SharinPix Image Sync Section above (2).
- Choose the Transformation of your choice(3).
- Enter the Value, that corresponds to the width/height parameters, in pixels, relative to which the image will be transformed(4). You can see the example and syntax for values to enter in this field here.
Go to Contacts and select an existing record or create a new one.
- Upload a new image.
- Refresh the current browser page.
- Select the new entry in the SharinPix Image section.
- You should see that a URL has been added tot the field Fill to Size (or in your case, the field you defined for the SharinPix Object).
When you follow the URL, you will be directed towards the new transformed image. In the figure below, the image has been subjected to a Fill to Size transformation with value 350 pixels.
The following screenshots illustrate the other types of transformations. To reproduce, the results, the steps are identical to those evoked above.
- Transformation: Fit to Size. Value: 500.
- Transformation: Pad to Size. Value: 500
- Transformation: Scale to Size. Value: 500.
Syntax for Value
The Value field can be filled with:
- a single value which stands for width and eight at the same time
- a double value, separated by an x which stand for width and then height
Examples of working values
500
500x300
1000x2000
800
Examples of not working values
500px
500-300
1000,2000
800p
0 Comments
Add your comment