Board index » delphi » JPG loadfromstream error on NT

JPG loadfromstream error on NT

Hello,

I get a problem doing a loadfromstream for a JPG. It occurs only on NT
running the .exe
It works fine on Win95 (it even works fine on both OS when I run from
Delph). Anyone
got a clue?

Stephen

------------------------------------------------------------------------------------

JPEGStream   : TBLOBStream;
JPEGImage    : TJPEGImage;

JPegImage  := TJPEGImage.Create;
JPEGStream :=
TBLOBStream.Create(TBLOBField(Table1.FieldByName('JPGImage')),bmRead);
JPegImage.Loadfromstream(JPEGSTREAM);
JPegStream.Free

 

Re:JPG loadfromstream error on NT


Stephen --

What is the problem?  What error do you get?  The code looks fine to
me.  What is the difference between the two machines in question?  Are
they both hitting the same database?

Nick Hodges - TeamB
Xapware Technologies -- http://www.xapware.com

Re:JPG loadfromstream error on NT


Hi Nick,

I get an "external exception" error on the loadfromstream when I run the
exe on NT. On Win95
there are no problems! Strange thing is, if I run it from Delphi (F9), the
error does not occur ...
(NT and Win95).

Regards,
Stephen

----------------------------------------------------------------------------------------------

JPEGStream   : TBLOBStream;
JPEGImage    : TJPEGImage;

try
    JPegImage  := TJPEGImage.Create;
    JPEGStream :=
TBLOBStream.Create(TBLOBField(Table1.FieldByName('JPGImage')),bmRead);
    JPegImage.Loadfromstream(JPEGSTREAM);
except
    on Ex : Exception
      showmessage(Ex.Message);
end;
JPegStream.Free

Quote
"Nick Hodges (TeamB)" wrote:
> Stephen --

> What is the problem?  What error do you get?  The code looks fine to
> me.  What is the difference between the two machines in question?  Are
> they both hitting the same database?

> Nick Hodges - TeamB
> Xapware Technologies -- http://www.xapware.com

Re:JPG loadfromstream error on NT


Where does the Table1 hook up?  I can't see anything wrong with your
code, so I can't explain the error.

Nick Hodges - TeamB
Xapware Technologies -- http://www.xapware.com

Re:JPG loadfromstream error on NT


Hi Nick,

Table 1 is a table in an Access db... Why should there be any difference
between running the
.exe and running in debug mode?  I'am really puzzeled....

Stephen

Quote
"Nick Hodges (TeamB)" wrote:
> Where does the Table1 hook up?  I can't see anything wrong with your
> code, so I can't explain the error.

> Nick Hodges - TeamB
> Xapware Technologies -- http://www.xapware.com

Re:JPG loadfromstream error on NT


On Mon, 31 Jan 2000 10:17:03 +0100, Stephen T'Siobbel <s...@here.be>
wrote:

Quote
>Why should there be any difference
>between running the
>.exe and running in debug mode?  I'am really puzzeled....

Usually something like that stems from the IDE loading something that
the application needs, but that doesn't get loaded when the
application runs apart from the IDE.  Usually it is a DLL of some
sort.

I'd get back to the very basics.  Try a simple example in a regular,
basic, do-nothing-but-return-the-image application and see.

Nick Hodges - TeamB
Xapware Technologies -- http://www.xapware.com

Re:JPG loadfromstream error on NT


Hi Nick,

I still can't solve the problem. I don't think its dll related.... Maybe
it has to do with
memory allocation.... I traced part of the VCL and noticed that the
loadfromstream uses
TMemoryStreams. Could it be that NT has a problem with this. (remember,
during debug
the external error (EEFACE) doen not occur). I see about 1/3 of the image
is loaded from the stream
when the error occurs... In the BDE is the that I can't  set the BLOB
SIZE for MSAcces ( I can
for Informix). When I open a Access DB and use a params.add('BLOB SIZE  =
1024') I don't get
a warning/error during compilion.....

I have prepared a small program and a mini access DB (with one JPG in a
BLOB) to test (180K zipped).
On request I can mail it....

Thanks for help/comments/...

Stephen

Quote
"Nick Hodges (TeamB)" wrote:
> On Mon, 31 Jan 2000 10:17:03 +0100, Stephen T'Siobbel <s...@here.be>
> wrote:

> >Why should there be any difference
> >between running the
> >.exe and running in debug mode?  I'am really puzzeled....

> Usually something like that stems from the IDE loading something that
> the application needs, but that doesn't get loaded when the
> application runs apart from the IDE.  Usually it is a DLL of some
> sort.

> I'd get back to the very basics.  Try a simple example in a regular,
> basic, do-nothing-but-return-the-image application and see.

> Nick Hodges - TeamB
> Xapware Technologies -- http://www.xapware.com

Other Threads