MCPcopy Create free account
hub / github.com/Snapchat/Valdi / outputImageInfo

Function outputImageInfo

libs/image_toolbox/src/image_toolbox/ImageToolbox.cpp:116–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116Valdi::Result<Valdi::BytesView> outputImageInfo(const Valdi::StringBox& imageFilePath) {
117 auto imageInfo = getImageInfo(imageFilePath);
118 if (!imageInfo) {
119 return imageInfo.moveError();
120 }
121
122 Valdi::Value json;
123 json.setMapValue("width", Valdi::Value(static_cast<int32_t>(imageInfo.value().width)));
124 json.setMapValue("height", Valdi::Value(static_cast<int32_t>(imageInfo.value().height)));
125
126 return Valdi::valueToJson(json)->toBytesView();
127}
128
129Valdi::Result<Valdi::BytesView> convertImage(const Valdi::StringBox& inputImageFilePath,
130 const Valdi::StringBox& outputImageFilePath,

Callers 1

imageInfoFunction · 0.85

Calls 5

getImageInfoFunction · 0.85
valueToJsonFunction · 0.85
valueMethod · 0.65
ValueClass · 0.50
toBytesViewMethod · 0.45

Tested by

no test coverage detected