Vampyre has its own file format registration system. There is a class TImageFileFormat, and there is a list ImageFileFormats which stores the parameters for all known file formats. Each file format has a reader/writer unit, and these units add the file format to the ImageFileFormatsList if such a unit exists in a uses clause.

FPC has a similar registration system, it registeres its own reader/writers in a similar list, ImageHandlers.

Vampyre does not take care of the FPC image type registration. But that's not the problem...

To make things worse, LCL has another registration system for the image types known to TPicture. There is a list TPicFileFormatsList which stores pointers to TPicFileFormat records. The instance of this list, PicFileFormats, is accessible only via a factory function GetPicFileformats which is not accessible from the outside. The formats known to the TPicture are added in the constructor of TPicFileFormatsList, again fully hidden inside the picture.inc. It is my impression there is no way to register a new format in any way without modifying the sources of TPicture.

This is bad... In my opinion, the TPicture file format registration should be moved into the interface part of the graphics unit so that the user can add his own image formats. Then Vampyre could call GetPicFileFormats.Add and provide the information for its own readers/writers; if there are duplicate formats the old ones should be removed in the Add call.

Werner

--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to