| 114 | } |
| 115 | |
| 116 | Valdi::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 | |
| 129 | Valdi::Result<Valdi::BytesView> convertImage(const Valdi::StringBox& inputImageFilePath, |
| 130 | const Valdi::StringBox& outputImageFilePath, |
no test coverage detected