Page 1 of 1

Error inserting PNG images

Posted: Thu Feb 16, 2012 12:47 pm
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.

Posted: Thu Feb 16, 2012 4:15 pm
by Sergey Tkachenko
Please give me the step-by-step instructions how to reproduce this problem.

Posted: Thu Feb 16, 2012 4:42 pm
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.

Posted: Thu Feb 16, 2012 4:51 pm
by Alexander_Dober
Hello,

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

initialization

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

finalization

UnRegisterClass(TPngImage);

Posted: Thu Feb 16, 2012 5:04 pm
by nostra
Alright, I have switch to TPNGImage instead of TPNGGraphic from the GraphicEx library and it seems to work now.

Thx