You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to store the format of an image in a metadata database and send them between systems in a natively serialized way and not as strings.
My specific use case for this functionality is a photo system which automatically transforms images into multiple formats using a task queue which gets processed by another service. Each task contains the target size and format and for this I need to serialize the format so it can be send to the processing service.
Right now this is possible by using a mime type string, but that makes the API not as nice to use and makes the API partly "stringly typed".
At the moment creating and reading a task looks something like this:
(Optionally/feature gated) implementing serde::Deserialize and serde::Serialize on ImageFormat would allow to use serde on structs/enums that contain an ImageFormat. The implementation could use the mime type internally. Same could be useful for ColorType enums.
The text was updated successfully, but these errors were encountered:
I think we could derive Serialize/Deserialize for these types. Though, it would require placing the derive within a cfg_attr so it was only enabled when serde a serde feature was on.
The enums are marked non-exhaustive which I don't think matters, but I could be wrong?
I would like to be able to store the format of an image in a metadata database and send them between systems in a natively serialized way and not as strings.
My specific use case for this functionality is a photo system which automatically transforms images into multiple formats using a task queue which gets processed by another service. Each task contains the target size and format and for this I need to serialize the format so it can be send to the processing service.
Right now this is possible by using a mime type string, but that makes the API not as nice to use and makes the API partly "stringly typed".
At the moment creating and reading a task looks something like this:
Draft
(Optionally/feature gated) implementing
serde::Deserialize
andserde::Serialize
on ImageFormat would allow to use serde on structs/enums that contain an ImageFormat. The implementation could use the mime type internally. Same could be useful for ColorType enums.The text was updated successfully, but these errors were encountered: