Print Page | Close Window

PdfLibrary v10: Bug when adding PNG

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3164
Printed Date: 22 Nov 24 at 11:41PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: PdfLibrary v10: Bug when adding PNG
Posted By: Walther
Subject: PdfLibrary v10: Bug when adding PNG
Date Posted: 20 Aug 15 at 8:41AM
DebenuPDFLibraryPNG.pas has a function TPNGReader.FilterData where there's a code snip like this:
  ...
    SetLength(FAlphaData, AlphaDataByteCount * FHeight);
    if Length(FImageData) > 0 then
    begin
      FillChar(FAlphaData[1], Length(FAlphaData), 0);
    end;
  ...

This code is buggy and should most likely be:
  ...
    SetLength(FAlphaData, AlphaDataByteCount * FHeight);
    if Length(FAlphaData) > 0 then                 // FAlphaData replaced here!!!
    begin
      FillChar(FAlphaData[1], Length(FAlphaData), 0);
    end;
  ...

This caused some confusion within our development team. Wink If this is not fixed in version 11, you could probably merge in the fix there.



Replies:
Posted By: Rowan
Date Posted: 20 Aug 15 at 9:27AM
Hi Walther,

Yes, you are correct, that appears to be a mistake. We'll fix that in the next release. Thanks!

Just be careful posting source code on forums, this is only a small snippet so not a big deal but preferably just post the version number, filename and line number with suggested change. If there's a bigger suggested change better to email Debenu directly.

Cheers,
- Rowan.


Posted By: Paul
Date Posted: 06 Nov 15 at 8:58AM
Hi Walther,

The issue was fixed and the solution is available in the version 12.11. You can download it form here:

http://www.debenu.com/products/development/debenu-pdf-library/trial/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk