IntelLabs / vdms

VDMS: Your Favorite Visual Data Management System
MIT License
84 stars 31 forks source link

FindImage with blob=False crashes server #90

Closed prashastk closed 5 years ago

prashastk commented 5 years ago

FindImage with blob=False crashes server

Server error:

"vdms: src/ImageCommand.cc:238: virtual Json::Value VDMS::FindImage::construct_responses(Json::Value&, const Json::Value&, VDMS::protobufs::queryMessage&, const string&): Assertion `findImage.isMember(""entities"")' failed.
/start.sh: line 5:    13 Aborted                 (core dumped) ./vdms
luisremis commented 5 years ago

Thanks for pointing this out! I have just created a PR to fix this.

One note. The following findImage command will still display an error:

{
    'FindImage': {
           'constraints': { // whatever contraints }, 
           'results': { 'blob': False } // without list
     }
}

This is becase no _ref or list in result is specified when blob=false. If blob=false, at least one of { _ref, list in results} must be specified for the query to be valid. If blob=false and neither _ref or list in results is specified, the query is essentially returning nothing (no properties of the image, no blob, not being referred later). VDMS will return an error in this case.

prashastk commented 5 years ago

There are other result parameters that can still be used other than list. Things like count, sum or average should also work.

Other than that, this sounds good to me.