Question

Why can't I load this png into my QPixmap? Open street map png

Q_ASSERT(fakeMap.load("C:/map71.png"));

This renders an ASSERT.

Does not render an ASSERT if I open it in MS paint and re saves it either as a jpeg or png (but larger in size). Same path and syntax.

Was it helpful?

Solution

The image you link to is actually a JPEG. If I save it with the jpg extension it loads into Qt ok. Qt is probably trying to treat it as a PNG and that's why it's failing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top