pcl icon indicating copy to clipboard operation
pcl copied to clipboard

Add rgb field if it doesn't exist when trying to add alpha value

Open larshg opened this issue 3 years ago • 1 comments
trafficstars

Added hasField and findField. Add rgb field, if not there and alpha should be added.

Should fix: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50652

Alternatively we should show an error that there is no rgb field to convert to rgba?

larshg avatar Sep 03 '22 15:09 larshg

I am wondering: does it make sense to add the new functions hasField and findField? There is already getFieldIndex which has pretty much the same purpose (documentation of the getFieldIndex functions could be improved though). And I currently don't see where hasField and findField could be useful outside of the one place in PLYReader.

Regarding the issue with rgb/alpha: maybe we should at least print a warning if there is no rgb yet? Would this additional check deal with property orders like x y z alpha red green blue?

mvieth avatar Sep 15 '22 12:09 mvieth

I changed it to use the method you mentioned - thanks :+1:

And I changed to just emit an error as well as returning an empty callback, as it seems to be an ill-defined header anyways, for a PLY file. At least a usable ply file with respect to PCL.

larshg avatar Oct 27 '22 05:10 larshg