lmdbxx icon indicating copy to clipboard operation
lmdbxx copied to clipboard

How can I save '0' ?

Open SuperWu090 opened this issue 9 years ago • 2 comments

Hi, When I try to save orgin image data using lmdb++, I find that I cannot save images containing piexls with gray-level zero. As I have to transform the image data into a string first, the string usually 'breaks' whenever there exits zero pixels. How can I solve this problem ? Thanks very much!

SuperWu090 avatar May 28 '16 16:05 SuperWu090

@SuperWu090

Have you tried to serializer the image struct to a string but prepad it with a character say a '#' every time; then upon deserialization from the string back to your struct, remove the first character (the '#' you pre-padded your data with). This will insure that your string is never empty.

ghost avatar Sep 08 '16 04:09 ghost

There should be another parameter size_t dataLength in the put method.

rgex avatar Sep 01 '17 15:09 rgex