Author |
Topic |
|
canoeist70
3 Posts |
Posted - Nov 28 2012 : 10:51:51
|
How do I read all the keywords? Assume keywords in photoshopped file are New Mexico; Canyon; Nature When I do the following I only retrieve the first keyword into the string variable temp (New Mexico) and can't see the others.
Idx:=ImageEnIO1.Params.IPTC_Info.IndexOf(2,25); temp:=ImageEnIO1.Params.IPTC_Info.StringItem[idx];
Thanks |
|
w2m
USA
1990 Posts |
Posted - Nov 28 2012 : 11:39:41
|
You have to loop through the IPTC_Info:
// GetIPTCInfo
procedure TForm1.GetIPTCInfo(const Filename: string);
var
i, j, k, l: integer;
ListItem: TListItem;
begin
ListView1.Clear;
for i := 0 to high(iptc) do
begin
ListItem := ListView1.Items.Add;
ListItem.Caption := iptc[i].s;
end;
// read IPTC
for j := 0 to high(iptc) do
with ImageEnView1.IO.Params.IPTC_Info do
begin
k := IndexOf(iptc[j].r, iptc[j].d);
if k >= 0 then
begin
// tag found
ListView1.Items.Item[j].SubItems.Add(StringItem[k]);
// look for other fields with the same recordnumber and dataset
for l := k + 1 to Count - 1 do
if (RecordNumber[l] = iptc[I].r) and (DataSet[l] = iptc[i].d) then
ListView1.Items.Item[j].SubItems.Add(StringItem[l]);
end;
end;
end;
William Miller Email: w2m@frontiernet.net EBook: http://www.imageen.com/ebook/ Apprehend: http://www.frontiernet.net/~w2m/index.html |
|
|
canoeist70
3 Posts |
Posted - Nov 28 2012 : 14:02:57
|
What is the variable "iptc" in for i := 0 to high(iptc) do
|
|
|
w2m
USA
1990 Posts |
Posted - Nov 28 2012 : 15:16:16
|
const iptc: array[0..30] of iptc_item = ((r: 2; d: 5; s: 'Object name'), (r: 2; d: 120; s: 'Caption/Abstract'), (r: 2; d: 25; s: 'Keywords'), (r: 2; d: 40; s: 'Special Instructions'), (r: 2; d: 55; s: 'Date Created (CCYYMMDD)'), (r: 2; d: 60; s: 'Time Created (HHMMSS±HHMM)'), (r: 2; d: 80; s: 'By-line'), (r: 2; d: 85; s: 'By-line'), (r: 2; d: 90; s: 'City'), (r: 2; d: 95; s: 'Province/State'), (r: 2; d: 100; s: 'Country/Primary Location Code'), (r: 2; d: 101; s: 'Country/Primary Location Name'), (r: 2; d: 103; s: 'Original Transmission Reference'), (r: 2; d: 110; s: 'Credit'), (r: 2; d: 115; s: 'Source'), (r: 2; d: 122; s: 'Writer/Editor'), (r: 2; d: 7; s: 'Edit status'), (r: 2; d: 10; s: 'Urgency'), (r: 2; d: 15; s: 'Category'), (r: 2; d: 20; s: 'Supplemental Category'), (r: 2; d: 22; s: 'Fixture Identifier'), (r: 2; d: 30; s: 'Release Date (CCYYMMDD)'), (r: 2; d: 35; s: 'Release Time (HHMMSS±HHMM)'), (r: 2; d: 45; s: 'Reference Service'), (r: 2; d: 47; s: 'Reference Date (CCYYMMDD)'), (r: 2; d: 50; s: 'Reference Number'), (r: 2; d: 65; s: 'Originating Program'), (r: 2; d: 70; s: 'Program Version'), (r: 2; d: 75; s: 'Object Cycle (a=morning, b=evening, c=both)'), (r: 2; d: 116; s: 'Copyright Notice'), (r: 2; d: 130; s: 'Image Type'));
William Miller |
|
|
canoeist70
3 Posts |
Posted - Nov 28 2012 : 15:28:09
|
OK, thanks. I'd already figured out that what I needed is the following code snippet. Thanks for your advice, it allowed me to figure this out.
with IPTC_Info do begin idx := indexof(2, 25); if idx >= 0 then begin temp := StringItem[idx]; for idx := idx + 1 to Count - 1 do if (RecordNumber[idx] = 2) and (DataSet[idx] = 25) then temp := temp+';'+StringItem[idx]; end; end;
|
|
|
w2m
USA
1990 Posts |
Posted - Nov 28 2012 : 16:16:09
|
Also there is a demo at ...ImageEn\Samples\InputOutput\IPTC
William Miller |
|
|
xequte
38615 Posts |
|
|
Topic |
|
|
|