Skip to content
Snippets Groups Projects
Commit 5fddccf1 authored by Jan David Mol's avatar Jan David Mol
Browse files

Fix looping over image vector elements when constructing pqxx query.

parent ba7eee3b
No related branches found
No related tags found
1 merge request!1L2SS-710: Fix looping over image vector elements when constructing pqxx query.
...@@ -208,11 +208,17 @@ public: ...@@ -208,11 +208,17 @@ public:
// In case of image, unwrap the vector. // In case of image, unwrap the vector.
assert(value.dim_x != 0); assert(value.dim_x != 0);
assert(value.dim_x * value.dim_y <= value.size());
std::stringstream result; std::stringstream result;
result << "{"; result << "{";
for(std::size_t i = 0; i != value.size() % value.dim_x; ++i) for(std::size_t i = 0; i != value.dim_y; ++i)
{ {
if (i > 0)
{
result << ",";
}
result << "{" << separated_list(",", std::next(value.begin(), i * value.dim_x), std::next(value.begin(), (i+1) * value.dim_x)) << "}"; result << "{" << separated_list(",", std::next(value.begin(), i * value.dim_x), std::next(value.begin(), (i+1) * value.dim_x)) << "}";
} }
result << "}"; result << "}";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment