QImage and QPıx cant read this png image but opencv does why ?
-
Hi,
I encountered a PNG image that neither :
QPixmap qpix(fileName)nor
QImage photo(fileName);can read . Both says invalid image.
But I can read with and succesfully convert them to qimage and qpix with opencv with :
cv::Mat cv_image = cv::imread(fileName.toStdString());Is there any clue why this is happening this png image. Other png images has no problem..
PS: When I convert to image to jpg or export as png again its working.
image is:
http://s000.tinyupload.com/?file_id=21483901468334087956
-
Hi
The mm.png is actually a jpg file.
It just has the wrong extension. -
@mrjj yes you right.. thanks a lot..
PS: QImage and QPixmap should check the file as opencv, it is deciding by their extension I assume.
-
@mrjj yes you right.. thanks a lot..
PS: QImage and QPixmap should check the file as opencv, it is deciding by their extension I assume.
@RahibeMeryem
Hi
Yeah, it can do some guessing looking at the header
but I think it only tries to guess if there is
not extension.