nanogui: Thread: Image size limit?


[<<] [<] Page 1 of 2 [>] [>>]
Subject: Image size limit?
From: "Martin Kajdas" ####@####.####
Date: 12 Jul 2006 15:53:47 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC229152A@mkmail.MKPROD.COM>

I have a FLTK application (+nxlib) that uses a built-in HTML viewer.
I created some HTML files with some jpg and png images.
The application works fine on X11 but when running on nano-X,
the smaller images show fine but when I get to pages that display
larger png images, the application crashes when it tries to display the image (from the log).
The images in question are 704x700 pixels and 792x490 in size (png, RGB, 32 bpp)
The images about half this size display fine.
I do not know the exact size that is borderline.

Any ideas?
Martin
Subject: Re: Image size limit?
From: "Greg Haerr" ####@####.####
Date: 12 Jul 2006 16:39:24 +0100
Message-Id: <0a6801c6a5c9$4f23e5c0$2f01a8c0@HaydenLake>

> The application works fine on X11 but when running on nano-X,
the smaller images show fine but when I get to pages that display
larger png images, the application crashes when it tries to display the 
image (from the log).
The images in question are 704x700 pixels and 792x490 in size (png, RGB, 32 
bpp)
The images about half this size display fine.
I do not know the exact size that is borderline.

Sounds like we've got a line length bytesize calculation
problem.  All this code is likely in nxlib/Image.c.  X11
and NX have differerent alignment requirements for
images, although this might not be the issue.  Normally,
NX handles images within the server, using the
specialized GrDrawImage calls for decoding.  X11
has applications handle decoding to any format, and
then the Image.c Xlib code translates this from many
formats to any number of formats, usually the one the
running X11 server prefers.  It's likely that there's
still some problems there.

There's considerable debug printf()s still in there,
perhaps try to find the codepath, and I'll help you.

Regards,

Greg 

Subject: RE: Image size limit?
From: "Martin Kajdas" ####@####.####
Date: 12 Jul 2006 16:45:08 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC229152B@mkmail.MKPROD.COM>

I already rounded all of my images to width multiple of 8 because 
otherwise they were distorted but that is another problem.

I will try to trace/log the code in Image.c and let you know but it will take a while.
Martin


-----Original Message-----
From: Greg Haerr ####@####.####
Sent: Wednesday, July 12, 2006 8:39 AM
To: Martin Kajdas; ####@####.####
Subject: Re: Image size limit?


> The application works fine on X11 but when running on nano-X,
the smaller images show fine but when I get to pages that display
larger png images, the application crashes when it tries to display the 
image (from the log).
The images in question are 704x700 pixels and 792x490 in size (png, RGB, 32 
bpp)
The images about half this size display fine.
I do not know the exact size that is borderline.

Sounds like we've got a line length bytesize calculation
problem.  All this code is likely in nxlib/Image.c.  X11
and NX have differerent alignment requirements for
images, although this might not be the issue.  Normally,
NX handles images within the server, using the
specialized GrDrawImage calls for decoding.  X11
has applications handle decoding to any format, and
then the Image.c Xlib code translates this from many
formats to any number of formats, usually the one the
running X11 server prefers.  It's likely that there's
still some problems there.

There's considerable debug printf()s still in there,
perhaps try to find the codepath, and I'll help you.

Regards,

Greg 

Subject: RE: Image size limit?
From: "Martin Kajdas" ####@####.####
Date: 12 Jul 2006 18:28:38 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC229152C@mkmail.MKPROD.COM>

The end of log before the crash:
...
XCreatePixmap 792,490 depth 16
XPutImage: fg=0x1 bg=0xffff0000 depth=16
XputImage depth 16  src 0,0 wxh 792,490 dst 0,0
putTrueColorImage depth 16  src 0,0 wxh 792,490 dst 0,0
putTrueColorImage nxmode = 5
XCreateBitmapFromData 792 490

where XCreateBitmapFromData is in CrBFData.c and calls GrNewPixmapFromData with image size 792x490
Anything else I should try?
Martin

-----Original Message-----
From: Greg Haerr ####@####.####
Sent: Wednesday, July 12, 2006 8:39 AM
To: Martin Kajdas; ####@####.####
Subject: Re: Image size limit?


> The application works fine on X11 but when running on nano-X,
the smaller images show fine but when I get to pages that display
larger png images, the application crashes when it tries to display the 
image (from the log).
The images in question are 704x700 pixels and 792x490 in size (png, RGB, 32 
bpp)
The images about half this size display fine.
I do not know the exact size that is borderline.

Sounds like we've got a line length bytesize calculation
problem.  All this code is likely in nxlib/Image.c.  X11
and NX have differerent alignment requirements for
images, although this might not be the issue.  Normally,
NX handles images within the server, using the
specialized GrDrawImage calls for decoding.  X11
has applications handle decoding to any format, and
then the Image.c Xlib code translates this from many
formats to any number of formats, usually the one the
running X11 server prefers.  It's likely that there's
still some problems there.

There's considerable debug printf()s still in there,
perhaps try to find the codepath, and I'll help you.

Regards,

Greg 

Subject: Re: [nanogui] RE: Image size limit?
From: "Greg Haerr" ####@####.####
Date: 13 Jul 2006 03:09:30 +0100
Message-Id: <008f01c6a621$13b04ad0$2f01a8c0@HaydenLake>

> XCreateBitmapFromData 792 490

Are you using the CVS code?  I seem to remember there
was a bug in GrCreateBitmapFromData that incorrectly
indexed a pixmap and core-dumped...

Regards,

Greg

Subject: RE: [nanogui] RE: Image size limit?
From: "Martin Kajdas" ####@####.####
Date: 13 Jul 2006 16:03:14 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC229152D@mkmail.MKPROD.COM>

Yes, I am using CVS from January 2006 and I do not see major changes since.
Martin


-----Original Message-----
From: Greg Haerr ####@####.####
Sent: Wednesday, July 12, 2006 7:07 PM
To: Martin Kajdas; ####@####.####
Subject: Re: [nanogui] RE: Image size limit?


> XCreateBitmapFromData 792 490

Are you using the CVS code?  I seem to remember there
was a bug in GrCreateBitmapFromData that incorrectly
indexed a pixmap and core-dumped...

Regards,

Greg

Subject: Re: [nanogui] RE: Image size limit?
From: "Greg Haerr" ####@####.####
Date: 13 Jul 2006 18:01:31 +0100
Message-Id: <013601c6a69c$d6dd1580$2f01a8c0@HaydenLake>

> where XCreateBitmapFromData is in CrBFData.c and calls GrNewPixmapFromData 
> with image size 792x490

Martin - put a few printfs in the GrNewPixmapFromData routine,
lets see whether this subroutine completes before crashing.  I'm
suspecting it doesn't, and then we can look at the routine
with more detail.

Regards,

Greg 

Subject: RE: [nanogui] RE: Image size limit?
From: "Martin Kajdas" ####@####.####
Date: 13 Jul 2006 18:35:41 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC229152E@mkmail.MKPROD.COM>

GrNewPixmapFromData calls GrNewBitmapFromData and GrBitmap.
- GrNewBitmapFromData call returns
- GrBitmap call does not return

In the GrBitmapWrapper there is a comment that it fails if size > 64K and sizeof(int)=2
I am running on Linux i386.

GrBitmap calls only memory copy functions.

Any ideas?
Martin


-----Original Message-----
From: Greg Haerr ####@####.####
Sent: Thursday, July 13, 2006 9:53 AM
To: Martin Kajdas; ####@####.####
Subject: Re: [nanogui] RE: Image size limit?



> where XCreateBitmapFromData is in CrBFData.c and calls GrNewPixmapFromData 
> with image size 792x490

Martin - put a few printfs in the GrNewPixmapFromData routine,
lets see whether this subroutine completes before crashing.  I'm
suspecting it doesn't, and then we can look at the routine
with more detail.

Regards,

Greg 

Subject: Re: [nanogui] RE: Image size limit?
From: "Greg Haerr" ####@####.####
Date: 13 Jul 2006 19:04:49 +0100
Message-Id: <019a01c6a6a6$cf94df60$2f01a8c0@HaydenLake>

Well, the GrBitmap function is very likely crashing
by memcpy'ing data outside the valid alloc'd range.
This is likely caused by incorrect calculations earlier
regarding either incoming bitmap size from NXLIB
or possibly bad bitmap linelength calculation, or
the for loop in the xxxFromData calls.  The for
loop sizing was the culprit in the earlier CVS
fix for crashing in these routines.

Another idea would be to force malloc() much
larger sizes in these routines along with printf()'ing
the sizes to compare with the incoming bitmap.

Regards,

Greg


GrNewPixmapFromData calls GrNewBitmapFromData and GrBitmap.
- GrNewBitmapFromData call returns
- GrBitmap call does not return

In the GrBitmapWrapper there is a comment that it fails if size > 64K and 
sizeof(int)=2
I am running on Linux i386.

GrBitmap calls only memory copy functions.

Any ideas?
Martin


-----Original Message-----
From: Greg Haerr ####@####.####
Sent: Thursday, July 13, 2006 9:53 AM
To: Martin Kajdas; ####@####.####
Subject: Re: [nanogui] RE: Image size limit?



> where XCreateBitmapFromData is in CrBFData.c and calls GrNewPixmapFromData
> with image size 792x490

Martin - put a few printfs in the GrNewPixmapFromData routine,
lets see whether this subroutine completes before crashing.  I'm
suspecting it doesn't, and then we can look at the routine
with more detail.

Regards,

Greg


Subject: RE: [nanogui] RE: Image size limit?
From: "Martin Kajdas" ####@####.####
Date: 13 Jul 2006 20:20:59 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC229152F@mkmail.MKPROD.COM>

GrNewBitmapFromData mallocated 49000 bytes, and it written also 49000 (from p - buf).
GrBitmap bitmapsize=49000, width and height also correct.
All the numbers make sense but memcpy (in GrBitmap) for some reason crashes.

I also added 50000 to GrNewBitmapFromData malloc() but still failed.

I ma really confused now.
Martin


-----Original Message-----
From: Greg Haerr ####@####.####
Sent: Thursday, July 13, 2006 11:05 AM
To: Martin Kajdas; ####@####.####
Subject: Re: [nanogui] RE: Image size limit?


Well, the GrBitmap function is very likely crashing
by memcpy'ing data outside the valid alloc'd range.
This is likely caused by incorrect calculations earlier
regarding either incoming bitmap size from NXLIB
or possibly bad bitmap linelength calculation, or
the for loop in the xxxFromData calls.  The for
loop sizing was the culprit in the earlier CVS
fix for crashing in these routines.

Another idea would be to force malloc() much
larger sizes in these routines along with printf()'ing
the sizes to compare with the incoming bitmap.

Regards,

Greg
[<<] [<] Page 1 of 2 [>] [>>]


Powered by ezmlm-browse 0.20.