You are here:
Update an Image
Add custom or modified images and icons in the app by updating the corresponding image contract.
Required Editions
| Available in: Enterprise, Performance, and Unlimited Editions |
| User Permissions Needed | |
|---|---|
| To update an image | Customizer, Admin |
- At the command prompt or in a Terminal window, change directory to the folder where the custom or replacement image file is saved.
-
Generate the Base64-encoded string for the replacement image file. Run:
sf modeler workspace utils base64encode --input $filePath$.For--input $filePath$, specify the path to the file for which the Base64-encoded string is required. The Base64-string of the file is written to the console. - Open the image contract of the existing image that you want to update.
- Copy the new Base64-encoded string from the console to the <default> tags.
-
Update the mimetype attribute if the new image file format is different from the existing
format.
Image Format Mimetype Value image.svg image/svg+xml image.png image/png - Save your changes and check in the modified image contract.
Example
Modified Barcode.image.xml image contract
<?xml version="1.0" encoding="utf-8"?>
<Image xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Barcode" schemaVersion="0.0.0.5">
<default mimetype="image/png">LDE3LjYsMTUuOSwxNC45LDE1eiIvPg0KCTwvZz4NCgk8ZyBpZD0iVW5yZWFkX01lc3NhZ2UiPg0KCTwvZz4NCgk8ZyBpZD0iRWRpdF9NZXNzYWdlIj4NCgk8L2c+DQoJPGcgaWQ9IkluYm94Ij4NCgk8L2c+DQoJPGcgaWQ9IkFkdmFuY2VkX1NlYXJjaCI+DQoJPC9nPg0KCTxnIGlkPSJJZGVhX3gzRl8iPg0KCTwvZz4NCgk8ZyBpZD0iUGFja2FnZXMiPg0KCTwvZz4NCgk8ZyBpZD0iX3gzRl9fMV8iPg0KCTwvZz4NCjwvZz4NCjwvc3ZnPg0K
<!-- details skipped for brevity -->
</default>
</Image>
Did this article solve your issue?
Let us know so we can improve!

