Error inserting PNG images

General TRichView support forum. Please post your questions here
Post Reply
nostra
Posts: 5
Joined: Thu Feb 16, 2012 12:38 pm

Error inserting PNG images

Post by nostra »

When a PNG (JPG and BMP work as expected) image is inserted using an rvAction or Drag'n'Drop, I get the following error message from FastMM:

Code: Select all

FastMM has detected an error during a FreeMem operation. The block footer has been corrupted. 

The block size is: 263

The block is currently used for an object of class: Unknown

The allocation number is: 1066966

The current thread ID is 0x1324, and the stack trace (return addresses) leading to this error is:

Current memory dump of 256 bytes starting at pointer address 7CD09A30:

00 00 00 00 FF 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 22 22 22 22 22 22 22

22 22 33 33 33 33 33 33 33 33 33 33 33 44 44 44 44 44 55 55 55 55 55 55 55 66 66 66 66 66 66 66

66 66 66 66 66 66 77 77 77 77 77 88 88 88 88 88 99 99 99 AA AA AA AA AA AA AA AA AA AA AA AA AA

AA AA AA AA BB BB BB BB BB BB BB BB BB BB BB CC CC CC CC CC CC DD DD DD DD DD DD DD DD DD DD EE

EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

.  .  .  .  ÿ  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  "  "  "  "  "  "  "

"  "  3  3  3  3  3  3  3  3  3  3  3  D  D  D  D  D  U  U  U  U  U  U  U  f  f  f  f  f  f  f

f  f  f  f  f  f  w  w  w  w  w  ˆ  ˆ  ˆ  ˆ  ˆ  ™  ™  ™  ª  ª  ª  ª  ª  ª  ª  ª  ª  ª  ª  ª  ª

ª  ª  ª  ª  »  »  »  »  »  »  »  »  »  »  »  Ì  Ì  Ì  Ì  Ì  Ì  Ý  Ý  Ý  Ý  Ý  Ý  Ý  Ý  Ý  Ý  î

î  î  î  î  î  î  î  î  î  î  î  î  î  î  î  î  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ

ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ

ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ

ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ  ÿ
The image is still inserted, but it disappears if it is moved in text.

I am using TRichViewEdit version 13.7.1 in Delphi 2010.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please give me the step-by-step instructions how to reproduce this problem.
nostra
Posts: 5
Joined: Thu Feb 16, 2012 12:38 pm

Post by nostra »

Hmm, it seems to be related to GraphicEx library, I am using.

Step by step instruction:
1. Create a new VCL Application
2. Drop TRichViewEdit and TRVStyle onto the Form and connect them
3. Add GraphicEx to uses
4. Run the application
5. Drag'n'Drop a PNG image onto the RichViewEdit

The image will disappear if you type some text and then try to move it somewhere else in RichViewEdit.
Alexander_Dober
Posts: 130
Joined: Fri Mar 04, 2011 3:44 am

Post by Alexander_Dober »

Hello,

are you registering TPngImage already?
uses ..., PngImage, ...

initialization

RegisterClass(TPngImage);
RV_RegisterHTMLGraphicFormat(TPngImage);
RV_RegisterPngGraphic(TPngImage);

finalization

UnRegisterClass(TPngImage);
nostra
Posts: 5
Joined: Thu Feb 16, 2012 12:38 pm

Post by nostra »

Alright, I have switch to TPNGImage instead of TPNGGraphic from the GraphicEx library and it seems to work now.

Thx
Post Reply