storage.fileTypes.images does not include JPEG files?

,

Hello all,

I have the following line in my plugin, which allows me to open a file dialog for users to select an image.

file = await fs.getFileForOpening({allowMultiple: false, types: storage.fileTypes.images});

I’m running into an issue where PNG and JPG files are selectable, but JPEG files are not. Is this a bug? It’s going to be extremely common for users to have .jpeg files so I’d love to learn of a work around.

Thank you very much in advance,

Tim

If I’m not mistaken storage.fileTypes.images is just an array of strings (I assume it includes extensions png and jpg but not jpeg). Instead of just passing storage.fileTypes.images, have you tried passing a new array concatenating storage.fileTypes.images with [“jpeg”]? And obviously I think one option always is to provide your own array of file extensions.

1 Like

Thank you! You’re right that it’s a basic array, and I can just append ‘jpeg’ to it. It would be good if UXP team added it to the array by default in the future.