Page 1 of 1

Access Denied in gflBitblt

Posted: Wed Aug 05, 2009 7:09 pm
by reggi
Hi!

I have always AccessDenied in procedure:

Code: Select all

procedure BlurFragment(X, Y, W, H, blur: integer; templImage: PGFL_BITMAP; bgColorGFL: TGFL_COLOR);
var
   cropRect: TGFL_RECT;
   fragment: PGFL_BITMAP; 
begin
     rC1 := repeatCount;
    try
        cropRect1.x:=X;
        cropRect1.y:=Y;
        cropRect1.w:=W;
        cropRect1.h:=H;

        fragment := gflAllockBitmap(gfl_bmp.BType,
                                  W-X,
                                  H-Y,
                                  gfl_bmp.LinePadding,
                                  @bgColorGFL);

        gflBitblt(templImage, @cropRect, @fragment, 0, 0);  
        
        gflGaussianBlur(fragment, nil, blurSize);
        
        cropRect.x:=0;
        cropRect.y:=0;
        cropRect.w:=fragment.Width;
        cropRect.h:=fragment.Height;
        
        gflBitblt(fragment, @cropRect, @templImage, X, Y); // HERE IS ACCESS DENIED...
    finally
        FreeAndNil(cropRect);
        gflFreeBitmap(fragment);
    end;
end;
I've no idea what's wrong :/ In my opinion the code is correct but... why there is AV? :/

Re: Access Denied in gflBitblt

Posted: Thu Aug 06, 2009 7:14 am
by dominique
Hello,

Here is something wrong, isn't it?

Code: Select all

        fragment := gflAllockBitmap(gfl_bmp.BType,
                                  W-X,
                                  H-Y,
                                  gfl_bmp.LinePadding,
                                  @bgColorGFL);
Should be

Code: Select all

        fragment := gflAllockBitmap(gfl_bmp.BType,
                                  W,
                                  H,
                                  gfl_bmp.LinePadding,
                                  @bgColorGFL);
to match with the cropRect ?

Re: Access Denied in gflBitblt

Posted: Thu Aug 06, 2009 8:18 am
by reggi
I KNOW!!

The problem is in the libgfl.pas file.

There is:

function gflBitblt(src: PGFL_BITMAP; rect: PGFL_RECT;
dst: PPGFL_BITMAP; x_dest, y_dest: GFL_INT32): GFL_ERROR; stdcall;

Should be:

function gflBitblt(src: PGFL_BITMAP; rect: PGFL_RECT;
dst: PGFL_BITMAP; x_dest, y_dest: GFL_INT32): GFL_ERROR; stdcall;

Re: Access Denied in gflBitblt

Posted: Mon Aug 10, 2009 12:04 pm
by xnview
Ok, i'll change it

Re: Access Denied in gflBitblt

Posted: Mon Aug 10, 2009 12:52 pm
by reggi
Will You change in libgfl.pas or in dll?
I think I can verify entire libgfl.pas because there are more errors, and then i'll send you it.

Re: Access Denied in gflBitblt

Posted: Mon Aug 10, 2009 12:55 pm
by xnview
reggi wrote:Will You change in libgfl.pas or in dll?
I think I can verify entire libgfl.pas because there are more errors, and then i'll send you it.
I'll change the .pas, the dll is correct with the C header

Re: Access Denied in gflBitblt

Posted: Mon Aug 10, 2009 1:36 pm
by reggi
OK.

Correct too error in line 265. There is:

Code: Select all

	
	ExtrasInfo: Pointer
    Name: PChar;
Should be with semicolon:

Code: Select all

    ExtrasInfo: Pointer;
    Name: PChar;

Re: Access Denied in gflBitblt

Posted: Tue Aug 11, 2009 7:00 am
by madiazg
Hello,
The errors I found in "libgfl.pas" are:

Code: Select all

//function gflSetColorAt(var dst: PGFL_BITMAP; x, y: GFL_INT32; var color: TGFL_COLOR): GFL_ERROR; stdcall; [ERROR]
   function gflGetColorAt(const src: PGFL_BITMAP; x, y: GFL_INT32; var color: TGFL_COLOR): GFL_ERROR; stdcall;

Code: Select all

//ExtrasInfo: Pointer [ERROR]
   ExtrasInfo: Pointer;

Code: Select all

//GFL_EXIF_MAIN_IFD             = $0001; [ERROR]
//GFL_EXIF_IFD_0                   = $0002; [ERROR]
   GFL_EXIF_MAIN_IFD             = $0002;
   GFL_EXIF_IFD_0                   = $0001;
and include:

Code: Select all

procedure gflBitmapSetEXIFValueRationalArray2(exif: PGFL_EXIF_DATAEX; ifd, tag: GFL_UINT16; const pq: PGFL_UINT32; count: GFL_INT32); stdcall;
The latter gives me an error in the EXIF data from Nikon cameras:
http://newsgroup.xnview.com/viewtopic.php?f=4&t=17966

Miguel Angel