sepinf-inc / IPED

IPED Digital Forensic Tool. It is an open source software that can be used to process and analyze digital evidence, often seized at crime scenes by law enforcement or in a corporate investigation by private examiners.
Other
884 stars 209 forks source link

Metadata Filter with numeric fields without ranges not working with other filters (master only) #2252

Closed wladimirleite closed 2 days ago

wladimirleite commented 3 days ago

I found this issue looking for images with the same width in a real case.

When a numeric field is used to filter items in the metadata panel and the scale is set to "no range" (i.e. exact numeric values are used), the results are correct if no other filter is applied. However, when I combine it with other filters (in the real case, I was filtering items with no bookmark), the results are wrong (completely wrong items or perhaps no items are shown).

The count shown in the metadata panel (in parentheses after the value) is correct, but the items shown in the main table are wrong. The problem may be related (or at least similar) to one reported in #2251, but I am not sure.

Putting some debug messages, it seems that the correct set of items are submitted to the function which counts the item per range/value. But when one range/value is selected, it asks for the n-th value (based on the filtered results) and then gets the items associated with the n-th value without filters, which may be different.

Working fine, with only metadata filter applied: image

Combined with a bookmark filter, the count is correct, but results are wrong. There is only one image in bookmark "B" with 1024 pixels of width. Results are showing images with 800 pixels of width. image

It is possible to reproduce the issue with any numeric integer field. Just in case, a sample set of images with different dimension, which helped me testing: sample-images.zip

lfcnassif commented 3 days ago

Thanks @wladimirleite for reporting, have you already found a fix? If not, @patrickdalla could you please also take a look at this? I think it is probably related to the filtering refactoring.

wladimirleite commented 3 days ago

Thanks @wladimirleite for reporting, have you already found a fix?

I tried to find a quick way to fix it, but unfortunately I couldn't.

patrickdalla commented 2 days ago

Hi @wladimirleite , I think this issue could be caused by the same cause of the issue 2251. I will not be able to review the code till monday. So, please, check if the issue was solved by the same commit that solved 2251, and if not, I will review the code later.

patrickdalla commented 2 days ago

The problem with this caching was that it was caching the order the user applied the filter. So I had to remove it to enforce the original order.

wladimirleite commented 2 days ago

Hi @wladimirleite , I think this issue could be caused by the same cause of the issue 2251. I will not be able to review the code till monday. So, please, check if the issue was solved by the same commit that solved 2251, and if not, I will review the code later.

This issue was also solved by the fix you made to #2251. Thanks @patrickdalla!!!