ztono
ztono

Reputation: 11

qt open a jpg file with warning image format not supported

screenshot of error

I open a file of format "jpg" in qt creator ,but qt creator returns a warning with "image format not supported". I also try other format as "png" ,but the waring is same.I hope someone can give me advice on it.I really need help.

Upvotes: 1

Views: 9446

Answers (2)

Prasanna Paudel
Prasanna Paudel

Reputation: 1

I faced the same problem . It was because i had already moved the png file in my projects folder. But i tried to add image by clicking add new where i should have clicked add existing.

Upvotes: 0

Farhad
Farhad

Reputation: 4181

This Warning is about PNG formats and Qt, Irrelevant to @ztono code. Read more about PNG (Portable Network Graphics) https://en.wikipedia.org/wiki/Portable_Network_Graphics

PNG has many Formats some old, some not standard for Qt. see more History_and_development You need to use Standard format in Qt.

You can convert your image to PNG Standard with Software.

OR

You can use QImage in Qt to convert your PNG pictures.

QImage *image = new QImage();
image->load("E:/Qt/TestProject/Images/connect.png");
image->save("E:/Qt/TestProject/Images/connect2.png");

Use new converted png and you will not see the warning.

Upvotes: 2

Related Questions