Repository navigation
How to add a new supported image format
Christopher Bruns edited this page Jul 18, 2026
·
5 revisions
- Create a small image in the new format and place it in test/images
- Make sure the image loads correctly when you drag it onto vimage.
- Ascertain whether you can save this image format correctly in vimage.
- In
main_window.py- Add the file extension to the list of extensions mentioned in
VimageMainWindow.load_main_image() - If this format can be saved, add its extension to the list in
VimageMainWindow._dialog_and_save_image()
- Add the file extension to the list of extensions mentioned in
- Create a new windows file association in file
CMake/wix_patch.xml- Create a new stanza in the
#PRODUCTsection, similar to the JpgOpenAssociation stanza - Insert the correct extensions and mime types. Consult https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types for some file type conventions.
- Insert a new unique guid (create one with windows powershell
[guid]::NewGuid()) - Add a corresponding ComponentRef in the
#ProductFeaturesection - (don't worry too much about the FileTypesFeature section until we get that part of the installer working...)
- Create a new stanza in the
- Create a new MacOS file association in the file
CMake/vimage_macos.spec- Under
CFBundleDocumentTypes, add a new stanza for the new file type. - Consult https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html for some mac file type conventions.
- See also https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
- Under
- Create a new linux association in CMake/resources/debian/mimetypes-vimage.xml