MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / load_image

Method load_image

src/common/AutoModel/modeling_gemma3_image.cpp:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "AutoModel/modeling_gemma3.hpp"
9
10bytes Gemma3::load_image(const std::string& filename) {
11 constexpr int target_width = 896;
12 constexpr int target_height = 896;
13
14 image_data_t decoded;
15 image_data_t resized;
16
17 if (!image_reader_.load_image(filename, decoded)) {
18 return bytes();
19 }
20
21 if (!image_reader_.resize_image(decoded, target_width, target_height, resized)) {
22 image_reader_.recycle(decoded);
23 return bytes();
24 }
25
26 image_reader_.recycle(decoded);
27 bytes result = std::move(resized.pixels);
28 resized.width = 0;
29 resized.height = 0;
30 return result;
31}
32
33bytes Gemma3::load_image_base64(const std::string& base64_string) {
34 constexpr int target_width = 896;

Callers

nothing calls this directly

Calls 3

bytesClass · 0.85
resize_imageMethod · 0.80
recycleMethod · 0.80

Tested by

no test coverage detected