Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'libpng error: Read Error' by using open cv imread [closed]

I am currently using Anaconda 4.3.27, Python 3.6.2 and OpenCV 3.3.0

When I try

img1 = cv2.imread('D:\Images\3D-Matplotlib.png')
img2 = cv2.imread('D:\Images\mainsvmimage.png')

I get libpng error: Read Errorand a pop-up shows up, indicating that Python stopped working. I already tried replacing the '' by '\' and '/', but also in those cases the same error shows up. When I try to read a jpg instead of a png, I do not get the error. Does anybody have an idea what might be the problem here?

Also cv2.imwrite gives an error:

libpng error: Write Error
like image 506
Jorre Goossens Avatar asked Oct 28 '25 23:10

Jorre Goossens


1 Answers

Had the same issue with Anaconda using Matplotlib with Latex. The solution was to update libpng. https://github.com/ContinuumIO/anaconda-issues/issues/6271

like image 150
Gregory Miller Avatar answered Oct 31 '25 15:10

Gregory Miller