Jump to content

GSoc/2023/StatusReports/UTKARSHKUMAR

From KDE Community Wiki

Improve Items Properties Management

Contacts

Email:-[email protected]
Contact No:- +91 6204808269

Summary

Digikam is an advanced open-source digital photo management application, compatible with Linux, Windows, and MacOS platforms, that offers a wide range of features for importing, managing, editing, and sharing photos and RAW files.s.

At present, users are facing a host of difficulties when they try to transfer properties such as color, tags, and labels to numerous pictures. This is resulting in an extremely laborious and monotonous task of copying them repeatedly. This project will introduce a more advanced and efficient approach.

Mentors : Gilles Caulier, Maik Qualmann, Thanh Trung Dinh

Blog Posts

https://utkarsh12.netlify.app/

Timeline

Week 1-2

During this week my focus on understanding the working of images tags and how they define in images i find out key words Tags are essentially labels or keywords that people attach to pictures or images to assist in categorization and organization. Working of Images Exif understanding.

My first target is to how In DigiKam were taglist of images. i Basially work on how can i modify the code view so select all taglists of images in just a single click. i checked out the codebase of digikam.

WHY IS IT IMPORTANT:-

  • They serve as descriptive metadata, facilitating easier searching and retrieval of specific images within a collection or database. Users can manually assign tags to images, or image recognition algorithms can automatically generate tags.

Users can create a taglist or a collection of tags associated with the images by assigning Multiples tages in once Time appropriate tags to pictures. This taglists helps user in selecting multiples tages in Once Time.

  • For instance, if we have a pictures Tag from a Taglist These tags can be employed to filter and add Multiples Tags in One click.
Largepx
Largepx
  • This is modification of DigiKam Taglist code.

"void TagList::saveSettings() {

   KSharedConfigPtr config = KSharedConfig::openConfig();
   KConfigGroup group      = config->group(QLatin1String("Tags Manager List"));
   QStringList itemList;
   for (ListItem* const listItem : d->tagListModel->allItems())
   {
       QList<int> ids = listItem->getTagIds();
       if (!ids.isEmpty())
       {
           itemList << QString::number(ids.first());
       }
   }
   group.writeEntry(QLatin1String("Items"), itemList);

}

void TagList::restoreSettings() {

   KSharedConfigPtr config = KSharedConfig::openConfig();
   KConfigGroup group      = config->group(QLatin1String("Tags Manager List"));
   QStringList itemList    = group.readEntry(QLatin1String("Items"), QStringList());
   /**
    * If config is empty add generic All Tags
    */
   d->tagListModel->addItem(QList<QVariant>() << QBrush(Qt::cyan, Qt::Dense2Pattern));
   if (itemList.isEmpty())
   {
       return;
   }
   for (const QString& item : itemList)
   {
       QList<QVariant> itemData;
       itemData << QBrush(Qt::cyan, Qt::Dense2Pattern);
       TAlbum* const talbum = AlbumManager::instance()->findTAlbum(item.toInt());
       if (talbum)
       {
           itemData << talbum->id();
       }
       ListItem* const listItem = d->tagListModel->addItem(itemData);
       // Use this map to find all List Items that contain a specific tag, usually to remove deleted tags
       for (int tagId : listItem->getTagIds())
       {
           d->tagMap[tagId].append(listItem);
       }
   }
   /**
    * "All Tags" item should be selected
    */
   QModelIndex rootIndex = d->tagList->model()->index(0, 0);
   d->tagList->setCurrentIndex(rootIndex);

}

void TagList::slotAddPressed() {

   QModelIndexList selected = d->treeView->selectionModel()->selectedIndexes();
   if (selected.isEmpty())
   {
       return;
   }
   QList<QVariant> itemData;
   itemData << QBrush(Qt::cyan, Qt::Dense2Pattern);
   for (const QModelIndex& index : selected)
   {
       TAlbum* const album = static_cast<TAlbum*>(d->treeView->albumForIndex(index));
       itemData << album->id();
   }
   ListItem* const listItem = d->tagListModel->addItem(itemData);
   /**
    * Use this map to find all List Items that contain a specific tag, usually to remove deleted tags
    * 
    */
   for (int tagId : listItem->getTagIds())
   {
       d->tagMap[tagId].append(listItem);
   }

}

void TagList::slotSelectionChanged() {

   QModelIndexList indexList = d->tagList->mySelectedIndexes();
   QSet<int> mySet;
   for (const QModelIndex& index : indexList)
   {
       ListItem* const item = static_cast<ListItem*>(index.internalPointer());
       if (item->getTagIds().isEmpty())
       {
           mySet.clear();
           break;
       }
       for (int tagId : item->getTagIds())
       {
           mySet.insert(tagId);
       }
   }
   TagsManagerFilterModel* const filterModel = d->treeView->getFilterModel();
   QList<int> lstFromSet(mySet.begin(), mySet.end());
   filterModel->setQuickListTags(lstFromSet);

}

void TagList::slotTagDeleted(Album* album) {

   TAlbum* const talbum = dynamic_cast<TAlbum*>(album);
   if (!talbum)
   {
       return;
   }
   int delId = talbum->id();
   QList<ListItem*> items = d->tagMap[delId];
   for (ListItem* const item : items)
   {
       item->removeTagId(delId);
       if (item->getTagIds().isEmpty())
       {
           d->tagListModel->deleteItem(item);
           d->tagMap[delId].removeOne(item);
           d->treeView->getFilterModel()->setQuickListTags(QList<int>());
       }
   }

}

void TagList::slotDeleteSelected() {

   QModelIndexList sel = d->tagList->selectionModel()->selectedIndexes();
   if (sel.isEmpty())
   {
       return;
   }
   for (const QModelIndex& index : sel)
   {
       ListItem* const item = static_cast<ListItem*>(index.internalPointer());
       d->tagListModel->deleteItem(item);
   }
   d->tagList->selectionModel()->select(d->tagList->model()->index(0, 0),
                                        QItemSelectionModel::SelectCurrent);

}

void TagList::enableAddButton(bool value) {

   d->addButton->setEnabled(value);

}

}"

The practice of tagging pictures or creating taglists is commonly Found Diffuculty All in Once a time.

Week 3-4

Week 5-6

Week 7-8

Week 9-10

Week 11-12