SuperFlyTV / GraphicsDataDefinition

A subset of JSON-schema, defining a generic data interchange bwtween graphics templates and their controllers
MIT License
16 stars 4 forks source link

"Extension" use in "File path" and "Image file path" #9

Open jstarpl opened 1 year ago

jstarpl commented 1 year ago

"File path" and "Image file path" both refer to a gddOptions.extensions property, that is an array that "Limit which files can be chosen by the user". The problem I see with that is that Web APIs (and some OS as well) generally don't rely on DOS-style "file name extensions" for restricting user file selection. I feel that GDD should follow Web API standards and use an array of MIME-types and MIME-type globs for limiting file types to be selected and expect the implementation to work out how to filter on those MIME-types.

In the case of Web apps (1) and Python (2) its free, Electron-based apps (3) would have to use a MIME-type database like mime-types if not using the Web API, same for C# MimeTypesMap - however it should be possible to interrogate OS mime-type database as well: (4) and (5)

nytamin commented 1 year ago

I agree fully! I initially just added those in there as examples of what a GDD-Type could be.

We should definitely rework them

didikunz commented 1 year ago

While "File path" is of broader range (it can be anything) I would limit the "Image file path" to the most common image file types png, tiff, targa and maybe bmp or svg. If one needs something else he could use the standard "File path" with the corresponding mime type. That would make the implementation of a UI simpler when one only needs images.