Access Denied in gflBitblt

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

Post Reply
User avatar
reggi
Posts: 16
Joined: Thu Sep 16, 2004 1:32 pm
Contact:

Access Denied in gflBitblt

Post by reggi » Wed Aug 05, 2009 7:09 pm

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? :/

User avatar
dominique
Posts: 72
Joined: Thu Nov 08, 2007 9:22 am

Re: Access Denied in gflBitblt

Post by dominique » Thu Aug 06, 2009 7:14 am

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 ?
Dom

User avatar
reggi
Posts: 16
Joined: Thu Sep 16, 2004 1:32 pm
Contact:

Re: Access Denied in gflBitblt

Post by reggi » Thu Aug 06, 2009 8:18 am

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;

User avatar
xnview
Author of XnView
Posts: 31488
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Access Denied in gflBitblt

Post by xnview » Mon Aug 10, 2009 12:04 pm

Ok, i'll change it
Pierre.

User avatar
reggi
Posts: 16
Joined: Thu Sep 16, 2004 1:32 pm
Contact:

Re: Access Denied in gflBitblt

Post by reggi » Mon Aug 10, 2009 12:52 pm

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.

User avatar
xnview
Author of XnView
Posts: 31488
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Access Denied in gflBitblt

Post by xnview » Mon Aug 10, 2009 12:55 pm

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
Pierre.

User avatar
reggi
Posts: 16
Joined: Thu Sep 16, 2004 1:32 pm
Contact:

Re: Access Denied in gflBitblt

Post by reggi » Mon Aug 10, 2009 1:36 pm

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;

User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias
Contact:

Re: Access Denied in gflBitblt

Post by madiazg » Tue Aug 11, 2009 7:00 am

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

Post Reply