[Lazarus] TDBImage -AV [SOLVED] for Jpeg images

Osvaldo Filho arquivostcf at gmail.com
Thu Sep 4 13:41:44 CEST 2008


> > line 175>>  if assigned(AGraphic) then AGraphic.Free;
This is not the problem, the problem is the fact that this code never
executed:
         if assigned(gc) then
           begin
           AGraphic := gc.Create;
           AGraphic.LoadFromStream(s);
           Picture.Assign(AGraphic);
           end;

Perhaps the problem is in :
FDataLink.DataSet.CreateBlobStream(FDataLink.Field,bmRead); // (lazarus
team)
or
s.readansistring; (please, see original code)
2008/9/4 Burkhard Carstens <fpc at bcsoft.de>

> Am Mittwoch, 3. September 2008 19:56 schrieb Osvaldo Filho:
> [..]
> > > The AV ocour here:
> > > dbimage.inc line 175
> > > ----------------------
> > >            Picture.Assign(AGraphic);
> > >            end;
> > >        finally
> > > line 175>>  if assigned(AGraphic) then AGraphic.Free;
> > >          s.Free;
> > >        end {try}
> > > ----------------------
>
> I didn't read the whole thread but one thing comes to mind: AGraphics is
> a local var, so it is not initialized (IIRC). Therefore
> assigned(AGraphics) (which just checks for non-nil pointer) returns
> probably true, even if it does not point to TGraphic instance. Just
> adding "AGraphics:=nil" at the beginning of the procedure might resolve
> the issue.
>
> regards
>  Burkhard
>
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080904/728317ce/attachment-0007.html>


More information about the Lazarus mailing list