Open saketsneha opened 4 years ago
In that case, sourceImageMat.empty() will be true, so you can throw an exception on that if you need it.
@saudet no its not returning empty Mat
@saudet I have this condition added if (!sourceImageMat.empty()) {} , its still going inside
You can try to use Leptonica instead. It has more options when it comes to loading images.
its a completely different library , there is nothing in javacv that can be helpful?I am not wanting to a new library.Thanks for reopening.
Leptonica is part of JavaCV...
https://tpgit.github.io/Leptonica/jpegio_8c_source.html this return a warning only.It would not be helpful right?I need an exception
I am using val sourceImageMat = imread(sourceImage.toString()) to read a file in java. But for corrputed images it just prints Premature end of JPEG file . I can see its not an exception and that is why its not ignoring the image but processing it further. Is there a way to avoid this processing? Have had a look at the community channel but was not of much help.Hope you can throw some ideas around this?