Unknown picture file extension (.gif)

General TRichView support forum. Please post your questions here
Post Reply
PetterT
Posts: 12
Joined: Fri Mar 22, 2013 5:32 am

Unknown picture file extension (.gif)

Post 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
PetterT
Posts: 12
Joined: Fri Mar 22, 2013 5:32 am

Post by PetterT »

What I meant is: Can I make TRichEdit / rvHtmlImporter ignore (don't try to load) gif's?

Petter
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
PetterT
Posts: 12
Joined: Fri Mar 22, 2013 5:32 am

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

Post by Sergey Tkachenko »

Version of Delphi?
Is HTML in UTF8?
PetterT
Posts: 12
Joined: Fri Mar 22, 2013 5:32 am

Post by PetterT »

Delphi Xe3
UTF8: Yes
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

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