Page 1 of 1

Load and save PNG in TDBRichViewEdit extremely slow

Posted: Mon Apr 30, 2012 10:00 am
by Joe
Hello Sergey,

Windows 7, Delphi 2010, RichView 13.8

First of all: TDBRichViewEdit works great!

Now my problem:
When loading a PNG graphic (160 KB) into the TDBRichViewEdit (with a simple line of text) and saving the record this takes 62 seconds! Loading takes 20 seconds.

With Paint I converted the PNG graphic to a JPEG which then has a size of 387 KB. Saving in the identical record takes less than 1 second, and also loading is not measureable.

In the support forum I found hints to use:
Classes.RegisterClass(TPngImage);
CRVData.RV_RegisterHTMLGraphicFormat(TPngImage);
CRVData.RV_RegisterPngGraphic(TPngImage);

I tried all that, but it makes no difference. Must I set some addional flags (e. g. rvrtfSaveBitmapDefault) or something like that?

Do you have any advice?

Thanks in advance
Joe

Posted: Tue May 01, 2012 3:30 pm
by Sergey Tkachenko
What's the saving format? RTF or RVF?
Can you send the field content with this PNG (saved as a file using BlobField.SaveToStream(FileStream) to richviewgmailcom?)

Posted: Wed May 02, 2012 8:03 am
by Joe
Hello Sergey,

the field format is rvdbRVF.

All further information is now send to you by email.

Best regards
Joe

Posted: Thu May 03, 2012 2:18 pm
by Sergey Tkachenko
Answered by email.

Posted: Sat May 05, 2012 7:49 am
by Joe
Very detailed information! Great support!

Thank you
Joe

Posted: Mon May 07, 2012 12:23 pm
by Ruediger Kabbasch
Hi,

Is it possible to provide the information to the public?

With kind regards,
Ruediger Kabbasch

Posted: Mon May 07, 2012 12:51 pm
by Joe
Hello Ruediger,

yes, of course it might be interesting to the public. The problem was caused by the datatype! of the underlying database field.

In this context I ran into another problem, caused by the datatype, too.

See my last answer in the following topic:
http://www.trichview.com/forums/viewtopic.php?t=5379

Best regards
Joe

Posted: Tue May 08, 2012 9:25 am
by Ruediger Kabbasch
Thanks!

Posted: Tue May 08, 2012 10:42 am
by Sergey Tkachenko
There were 2 problems

1) Because of "Unicode memo" field type, data were saved as RTF converted to Unicode string. Pictures in RTF ==> twice in size. RTF to Unicode string ==> twice in size. As a result, a picture is increased by 4 times from the original size.
2) Due to property setting or due to the insertion methods, the picture was saved not as PNG but as a metafile containing bitmap (large size).