Lord Satan wrote:
On Mon, 17 Sep 2007 18:17:43 +0200
Marc Weustink <[EMAIL PROTECTED]> wrote:

Lord Satan wrote:

To me this looks like Marcs new image code is responsible for my troubles.
As far as I can tell from the code you gave not. But the given code and probelmdescription is a bit limited.

This assumption was only based on revision number. What other information do 
you need?

See below

[snip]

  MemStream:=nil;
  try
    // read file into mem
    MemStream:=TMemoryStream.Create;
    MemStream.CopyFrom(FileStream,FileStream.Size);
    // convert stream to texture
    MemStream.Position:=0;
    if ReaderClass<>nil then begin
      Reader:=ReaderClass.Create;
      try
        LoadFromStream(MemStream, Reader); << This fails
What error ? (*)

        Result:=true;
      except
        Result:=false;
        Free;
        ShowMessage('Error reading file'); << because this I get in an endless 
loop
This wonders me, why do you get here an endless loop ? Where is the loop ?

If I only knew. I am just loading 6 or 7 pics (some bmp, and a png). Perhaps it 
is not an endless loop but it at least spams the terminal with the above shown 
output and throws exception message dialogs until I kill it.

If you just try one image and look if that works. Debugging that is often easier than whole bunch.

(*) thy using:
except
   on E: exception do
   begin
     Result:=false;
     Free;
     ShowMessage('Error reading file: ' + E.Message);
   end;

The error is an 'invalid type cast'.

That comes somewhere. If you run your app in lazarus, dou you get a call stack when you get this exception ?

Marc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to