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

Method load_image_base64

src/common/AutoModel/modeling_gemma3_image.cpp:33–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33bytes Gemma3::load_image_base64(const std::string& base64_string) {
34 constexpr int target_width = 896;
35 constexpr int target_height = 896;
36
37 image_data_t decoded;
38 image_data_t resized;
39
40 if (!image_reader_.load_image_base64(base64_string, decoded)) {
41 return bytes();
42 }
43
44 if (!image_reader_.resize_image(decoded, target_width, target_height, resized)) {
45 image_reader_.recycle(decoded);
46 return bytes();
47 }
48
49 image_reader_.recycle(decoded);
50 bytes result = std::move(resized.pixels);
51 resized.width = 0;
52 resized.height = 0;
53 return result;
54}
55
56///@brief: preprocess the image for gemma3 model
57///@note: 1. Reorder: 896x896x3 -> 3x896x896

Callers

nothing calls this directly

Calls 3

bytesClass · 0.85
resize_imageMethod · 0.80
recycleMethod · 0.80

Tested by

no test coverage detected