[Qt-interest] SOLVED QImageReader cannot detect image format

Steven Doerfler sgd-qt at lugaru.com
Thu May 6 16:35:40 CEST 2010


On 5/6/2010 3:19 AM, Guido Seifert wrote:
> This is sick. I found the problem. When in the QImageReader docs 'filename' is written, 'filename' is meant. NOT an absolute file path.

That would be odd, since the only thing QImageReader::imageFormat(const
QString &fileName) does with the filename you pass to it is to create a
QFile with it (in Qt 4.6.2 at least).  Since QFile takes absolute file
paths, so does QImageReader::imageFormat.

Why don't you show us the line of code that isn't working, and the types
and values of any variables used on that line?  Are you sure you have
permission to read the file?  Does directly passing that same file name
to QFile fail too?

Steven






More information about the Qt-interest-old mailing list