photo:addKeyword( keyword ) by several photos
Hello! Faced with such a problem. The value of metadata trying to make keywords.
If one photo is selected, then everything works out correctly.. But if you choose 2 or more photos, the error falls out "Внутренняя ошибка: assertion failed!"
local photos = catalog.targetPhotos
local countPhotos = #photos
local keywords = catalog:getKeywords()
local keywordCategory
for k, keyword in ipairs(keywords) do
if keyword:getName() == "PERSON" then
keywordCategory = keyword
end
end
for i, photo in ipairs(photos) do
local participant = photo:getFormattedMetadata("licensor") or ""
local participantCount = #participant
keywordPerson = catalog:createKeyword( photo:getFormattedMetadata ("licensor")[1].LicensorName, nil, false, keywordCategory, true )
photo:addKeyword( keywordPerson )
end
Tell me what I'm missing. Like in a loop should run through all the photos. Metadata in the same way inserts...