Qt-interest Archive, December 2006
a tough one
Message 1 in thread
Okay, I think this one is a tough one. I am using a QTextBrowser to
read HTML files. In the files there are links to very small .gif
files like 82 bytes small. Everytime it runs into one of these
images I get the following error:
QPixmap::convertFromImage: Cannot convert a null image
I have checked the size of these files and they are definitely not
0. I am running on Mac OS X and yes I compiled with GIF support and
I know it works because there are links to other .gif images (larger
ones) that work just fine.
Any ideas?
-----------------------------------------------------
Justin M. Bradley
Research Assistant
MAGICC Lab
Electrical and Computer Engineering
Brigham Young University
http://www.et.byu.edu/~jmb275
jmb275@xxxxxxxxxx
-----------------------------------------------------
Message 2 in thread
On 12/19/06, Justin Bradley <bradley.justin@xxxxxxxxx> wrote:
> Okay, I think this one is a tough one. I am using a QTextBrowser to read
> HTML files. In the files there are links to very small .gif files like 82
> bytes small. Everytime it runs into one of these images I get the following
> error:
> QPixmap::convertFromImage: Cannot convert a null image
>
> I have checked the size of these files and they are definitely not 0. I am
> running on Mac OS X and yes I compiled with GIF support and I know it works
> because there are links to other .gif images (larger ones) that work just
> fine.
It is a valid GIF image? Maybe there a problem with the images that
the loader can't fix?
--
[ signature omitted ]
Message 3 in thread
Robin Ericsson schrieb:
> On 12/19/06, Justin Bradley <bradley.justin@xxxxxxxxx> wrote:
>> ...
>> I have checked the size of these files and they are definitely not 0.
>> I am
>> running on Mac OS X and yes I compiled with GIF support and I know it
>> works
>> because there are links to other .gif images (larger ones) that work just
>> fine.
>
> It is a valid GIF image? Maybe there a problem with the images that
> the loader can't fix?
Isn't there an example Qt application (check the "examples" folder of
your Qt directory) which can load and display images? Try it as to
verify whether the Qt GIF loader can load the GIF images in question.
You can also verify this yourself in about a dozen lines of code, among
them something like:
QImage image;
bool isOk;
// filePath points to GIF, check the result
isOk = image.load (filePath);
Cheers, Oliver
--
[ signature omitted ]
Message 4 in thread
On 12/19/06, Justin Bradley <bradley.justin@xxxxxxxxx> wrote:
> I suppose that's possible but it works in real web browsers i.e.
> firefox, safari, etc.
Are the image real images or just spacers? Maybe the other browser
consider them to small to actually display a faulty image.
--
[ signature omitted ]
Message 5 in thread
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robin Ericsson schrieb:
> On 12/19/06, Justin Bradley <bradley.justin@xxxxxxxxx> wrote:
>> I suppose that's possible but it works in real web browsers i.e.
>> firefox, safari, etc.
AFAIK Safari is Mac-only, and on Mac you have
/these/kind/of/path/delimiters, not the c:\windows\path\delimiters.
So how can you be sure that it works in Safari? ;)
Also note that when viewing your pages locally it might indeed work with
'\', but when serving them over the net I doubt you can specify
paths\like\this.
Cheers, Oliver
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFiRKyHVnxr7UPh0MRAo+tAKCdrbQlovdRussZ9t9Ch/FyqMSNDgCePDPS
BApXCgdnwqpNE8n8A1/JX48=
=PEf+
-----END PGP SIGNATURE-----
--
[ signature omitted ]
Message 6 in thread
Hi,
> I have checked the size of these files and they are definitely not 0. I
> am running on Mac OS X and yes I compiled with GIF support and I know it
> works because there are links to other .gif images (larger ones) that
> work just fine.
Maybe the links to the small images are somehow different or not valid.
--
[ signature omitted ]
Message 7 in thread
Dimitri schrieb:
> Maybe the links to the small images are somehow different or not valid.
On that note: Beware of using windows paths (with backslash) in HTML!
Make sure you use slashes only...
Martin
--
[ signature omitted ]