Load and save PNG in TDBRichViewEdit extremely slow

General TRichView support forum. Please post your questions here
Post Reply
Joe
Posts: 28
Joined: Tue Feb 14, 2012 6:15 am

Load and save PNG in TDBRichViewEdit extremely slow

Post 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
Sergey Tkachenko
Site Admin
Posts: 17604
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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?)
Joe
Posts: 28
Joined: Tue Feb 14, 2012 6:15 am

Post by Joe »

Hello Sergey,

the field format is rvdbRVF.

All further information is now send to you by email.

Best regards
Joe
Sergey Tkachenko
Site Admin
Posts: 17604
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Answered by email.
Joe
Posts: 28
Joined: Tue Feb 14, 2012 6:15 am

Post by Joe »

Very detailed information! Great support!

Thank you
Joe
Ruediger Kabbasch
Posts: 17
Joined: Thu Aug 03, 2006 4:50 pm
Location: Germany

Post by Ruediger Kabbasch »

Hi,

Is it possible to provide the information to the public?

With kind regards,
Ruediger Kabbasch
Joe
Posts: 28
Joined: Tue Feb 14, 2012 6:15 am

Post 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
Ruediger Kabbasch
Posts: 17
Joined: Thu Aug 03, 2006 4:50 pm
Location: Germany

Post by Ruediger Kabbasch »

Thanks!
Sergey Tkachenko
Site Admin
Posts: 17604
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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).
Post Reply