Page 1 of 1
Unknown picture file extension (.gif)
Posted: Wed Apr 24, 2013 5:27 am
by PetterT
I'm getting the exception "Unknown picture file extension (.gif)" when loading some Html content into TRichView using rvHtmlImporter.
How can I fix this?
Petter
Posted: Thu Apr 25, 2013 7:51 am
by Sergey Tkachenko
Posted: Mon Apr 29, 2013 9:20 am
by PetterT
What I meant is: Can I make TRichEdit / rvHtmlImporter ignore (don't try to load) gif's?
Petter
Posted: Mon Apr 29, 2013 11:00 am
by Sergey Tkachenko
If you do not use TGifImage as it is explained in that topic, gif images will be ignored by default (loaded as RVStyle.InvalidPicture).
The exception is handled, it is noticeable only when debugging in IDE.
Posted: Mon Apr 29, 2013 11:43 am
by PetterT
Sergey, I turns out that the Html code that contains the Gif reference should be removed before the rvHtmlImporter is used.
I load my Html into a Memo and manipulate the Html.
How do I get to use the rvHtmlImporter.LoadHtml from a Memo?
Petter
Posted: Mon Apr 29, 2013 5:07 pm
by Sergey Tkachenko
Version of Delphi?
Is HTML in UTF8?
Posted: Tue Apr 30, 2013 4:18 am
by PetterT
Delphi Xe3
UTF8: Yes
Posted: Tue Apr 30, 2013 3:54 pm
by Sergey Tkachenko
Loading in memo:
Code: Select all
Memo1.Lines.DefaultEncoding := TEncoding.UTF8;
Memo1.Lines.LoadFromFile(OpenDialog1.FileName);
Importing:
Code: Select all
RvHtmlImporter1.BasePath := ExtractFilePath(OpenDialog1.FileName);
RvHtmlImporter1.Encoding := rvhtmleUTF8;
RvHtmlImporter1.LoadHtml(UTF8Encode(Memo1.Lines.Text) );