You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, June 21st 2012, 12:26pm

Bugs of QImage?

My program always crash when the format of the QImage is QImage::Format_Indexed8
Other format would not crash but
QImage::Format_Indexed8


example one

Source code

1
2
3
    QImage src(2, 2, QImage::Format_Indexed8);
    QImage src2 = src.copy();
    std::cout<<std::boolalpha<<(src == src2)<<std::endl;


example two

Source code

1
2
3
4
5
QImage src("../GIL_with_Qt/images_00/lena/lena.jpg");
src = src.convertToFormat(QImage::Format_Indexed8);
QImage dst(src.size(), src.format());       
 
dst.save("E:/lena/lena_Format_Indexed8.jpg");


compiler : vc2010(32bits)
os : win7 64bits
qt ver : Qt4.8.1

Thank you very much

ps : Please don't care about the codes make sense or not, this is not the point of this post

2

Thursday, June 21st 2012, 4:07pm

what is the exception/error?
what is the callstack?
what is the line of code that causes the problem?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

3

Thursday, June 21st 2012, 4:39pm

additionally, are yuo running debug/release? can you show which qt dlls/shared library versions you are linking with?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

4

Saturday, June 23rd 2012, 11:31am

> what is the line of code that causes the problem?
example 1 :
http://pastebin.com/RKQYkvkf

example 2 :
http://pastebin.com/X4Vfp3LF

>what is the exception/error?
both of them give me the same error messages

https://152f08cb-a-62cb3a1a-s-sites.goog…&attredirects=0

>are yuo running debug/release?
debug(release mode also crash)

>what is the callstack?
How could I observe the callstack under QtCreator?
Besides, this is nothing like the bug of my program but Qt4.8.1
The codes are 3~4 lines, they are all under "main()"

>dlls/shared library
I think it would be the dll of Qt4.8.1.Since there are only
one environment path "C:\Qt\4.8.1\bin;" which contains the dll of Qt
on my pc.

Thanks a lot

ps : when I wrap the codes with code tags or try to show the image by the img tags
the results are pretty weird, so I present the codes and the link of the image
without those tags,sorry for the inconvenient.

This post has been edited 4 times, last edit by "stereoMatching" (Jun 23rd 2012, 11:56am)


5

Saturday, June 23rd 2012, 12:14pm

>what is the callstack?
How could I observe the callstack under QtCreator?

not sure how well creator works. With studio it's just a case of looking at the stack window http://wwwimages.adobe.com/www.adobe.com…tudio/fig06.jpg

It does look very bug-like, though.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

6

Saturday, June 23rd 2012, 12:16pm

are you meant to make QImage before qapp??
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

7

Saturday, June 23rd 2012, 1:17pm

If I ran your example and get the same problem.

not sure why it is - it doesn't look nice!
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

8

Tuesday, June 26th 2012, 10:05pm

>
are you meant to make QImage before qapp??
yes, even with qapp it is still crash.