Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-01

questions on fpimage

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi,

firstly a happy new year to you all and keep on rocking!

While reading the fpimage unit code I found some pieces I don't understand and could not clear up reading the docs. Here we go:

<code>
TFPCustomImage = class(TPersistent)
[...]
    public
[...]
      property  Extra [const key:string] : string read GetExtra write SetExtra;
      property  ExtraValue [index:integer] : string read GetExtraValue write SetExtraValue;
      property  ExtraKey [index:integer] : string read GetExtraKey write SetExtraKey;
      procedure RemoveExtra (const key:string);
      function  ExtraCount : integer;
</code>

Whats that good for? Ist to tag images inside my own program or does it handle image meta data like EXIF and stuff?

And at the end:

<code>
initialization
  ImageHandlers := TImageHandlersManager.Create;
</code>

Looking at this class it seems to be sort of a type registry, maybe able to detect type and name or instantiate the reader and writer classes. How ist that to be used and do I need to care for?

TIA,
Marc

Reply by email

Mattias Gaertner
to Marc Santhoff
Show quoted text 21 lines
Hi, firstly a happy new year to you all and keep on rocking! While reading the fpimage unit code I found some pieces I don't understand and could not clear up reading the docs. Here we go: <code> TFPCustomImage = class(TPersistent) [...] public [...] property Extra [const key:string] : string read GetExtra write SetExtra; property ExtraValue [index:integer] : string read GetExtraValue write SetExtraValue; property ExtraKey [index:integer] : string read GetExtraKey write SetExtraKey; procedure RemoveExtra (const key:string); function ExtraCount : integer; </code> Whats that good for? Ist to tag images inside my own program or does it handle image meta data like EXIF and stuff?

Yes. Both.

Show quoted text 10 lines
And at the end: <code> initialization ImageHandlers := TImageHandlersManager.Create; </code> Looking at this class it seems to be sort of a type registry, maybe able to detect type and name or instantiate the reader and writer classes. How ist that to be used and do I need to care for?

All image formats register themselves there.
It is used by
TFPCustomImage.FindHandlerFromExtension
and
TFPCustomImage.LoadFromStream

You can query it yourself or use the above.

Mattias

Reply by email

Marc Santhoff
to Mattias Gaertner
Mattias Gaertner wrote 26 lines
On Tue, 03 Jan 2017 02:54:05 +0100 Marc Santhoff wrote: > Hi, > > firstly a happy new year to you all and keep on rocking! > > While reading the fpimage unit code I found some pieces I don't > understand and could not clear up reading the docs. Here we go: > > <code> > TFPCustomImage = class(TPersistent) > [...] > public > [...] > property Extra [const key:string] : string read GetExtra write SetExtra; > property ExtraValue [index:integer] : string read GetExtraValue write SetExtraValue; > property ExtraKey [index:integer] : string read GetExtraKey write SetExtraKey; > procedure RemoveExtra (const key:string); > function ExtraCount : integer; > </code> > > Whats that good for? Ist to tag images inside my own program or does it > handle image meta data like EXIF and stuff? Yes. Both.

OK, fine. But there is no code doing sth. like reading EXIF tags from files, I have do do myself?

I was hoping to find some code handling image comments and the like, still searching for meta data access. ;)

Show quoted text 18 lines
> And at the end: > > <code> > initialization > ImageHandlers := TImageHandlersManager.Create; > </code> > > Looking at this class it seems to be sort of a type registry, maybe able > to detect type and name or instantiate the reader and writer classes. > How ist that to be used and do I need to care for? All image formats register themselves there. It is used by TFPCustomImage.FindHandlerFromExtension and TFPCustomImage.LoadFromStream You can query it yourself or use the above.

Nice and helpful, thanks.

Marc

Reply by email