Archive for the ‘Krita’ Category

What I did in GSOC . . .

August 23, 2011 1 comment


       I am so glad that I successfully completed my gsoc project with the help of my mentor Sven Langkamp, Boudewijn Rempt, and other KDE people. During this period, I learnt a lot from them like how to get some help from other people, how to write the code, committing, testing and also sending it for review. On doing this, I got confidence that I can involve in any open source project and can contribute the best :). Especially, what I like the most in the KDE people is there constant and quick help for the new people , I will follow that . . .

      I want to blog all the things, I did under GSOC Project as a future reference for me. My work is under Krita, and in that

 Resource Management Part

1). GHNS support for the resources – This one is to download and share resources among the users and it is successfully completed. While doing this, I met some new people Frederik Gladhorn and Frank Karlitschek, I asked them how to add categories for resources in the server and did that work. I take so much time for doing this one, I did the things like setting up the downloading functionality, removing the resources and also uploading the resources.

2). Blacklisting the files – We don’t delete the files from the computer. Just we save the names of the files in the XML file and make these files not to upload into the application. At first, we add this functionality only to the readonly files. At the end, we make it available to all types of resources based on user feedback. For restoring resources, I started creating the dialog and it takes some more days to complete.

Tagging Part

1). Tagging UI and XML part: Tagging part helps the users to tag their resources and retrieve them quickly at the time of need. In this part, we added the functionality like adding tag, deleting tag and searching the resources using tags. Initially all these are implemented in XML to make it compatible with GIMP. So, all the tagging conventions used in gimp are used in krita also. But, the compatibility is not yet supported because GIMP is using a variable to store the resource directory address. We need to get that address and make it available in krita. I think, it is a little work and we need to ask that in GIMP mailing list. But at present, the tagging with XML is working fine.

2). Nepomuk backend for Tagging: We add the same tagging functionality with the nepomuk backend also, to support the exchange of tags information with other kde applications. It is also working fine in krita. While doing this, Sebastian Trüg, Vishesh Handa and swair help me a lot to add the nepomuk functionality to krita. Thanks for them .

Sketchbook Tagging

      This will help to store the status of the dockers and use them afterwards. For example, if an artist works on drawing comics, he can save the preferences of resources in the dockers and can shift his work to other type of drawing and come back to the comics drawing immediately with the help of the saved status. This one is also implemented in krita but not yet tested.

   On the whole, Resource Management part and Tagging part are merged into the git master and ready for use. But the sketchbook tagging need to have tested and it will be available to users in some days time. My todo list contains adding tagging part to the image docker and completion of restore resources dialog. I will blog again, when these are completed 🙂

Categories: Krita

Why Nepomuk in Krita . . .

August 6, 2011 3 comments

Hi KDE Folks,

      In my previous post, I mentioned about the implementation of Nepomuk and XML backends for Krita. Many asked me what’s the use of nepomuk or XML, which one is best and so on. I want to clear those doubts in this post . . .

     Coming to XML – We started implemented tagging in XML to get the opportunity of exchanging resources between Gimp and Krita. And later we moved on to nepomuk, so that with nepomuk we have the following advantages

  • Add and delete tags using kde apps containing nepomuk feature – these changes will be effected once you restart krita application.
  • Search resources by using tags in kde apps

 The following picture is adding tags for the resources in dolphin

     But the problem with nepomuk works only kde libraries, we can’t use this feature in Gnome environment. Xml can be used in both environments but not able to share tags with other kde apps.

    On the whole, both have its own advantages and disadvantages. I completed the implementation part of both backends and also sent for review to merge the code into the master. In few days, the nepomuk feature will be available to you . . . 😀

Categories: Krita

Two Backends for tagging in Krita

July 22, 2011 5 comments

Hi KDE Folks,

     Finally completed two backends support for Tagging in Krita – one is XML and another is NEPOMUK :). I am thankful for the nepomuk developers, who helped me to integrate nepomuk in my project especially Vishesh Handa, Sebastian Trüg and Swair. And also I am glad to have a quick response from KDE people to my previous post. In these two weeks, I setup nepomuk backend, added GUI to change backends and also added unit test for testing the nepomuk part.

     For choosing the backend, we need to go to settings -> configure krita -> general settings. There we can select the backend we like using radio buttons.

     For this backend support, we didn’t change the existing code but added some functions to store and retrieve tags from Nepomuk. While doing this work, I get to know two things

1). Using cmake variable in #ifdef

I struggled a lot to use #ifdef statements. I added all the stuff required but forget to add the header file “KoConfig.h” where I defined the cmake variable. What a silly mistake, I did . . 😀

2). Storing the variables for sessions

       For this, I used kconfig like this

       KConfigGroup m_config;

        m_config = KConfigGroup( KGlobal::config(), “resource tagging” );

        m_nepomukOn = m_config.readEntry(“nepomuk_usage_for_resource_tagging”, false);

  On the whole, I completed the multi-backend support for tagging and now going to Image docker section, where I need to integrate tag support for images. .

Categories: Krita

Implementing Nepomuk as another backend for tagging

July 3, 2011 9 comments

Hi KDE Folks,

     I got some nice comments on tagging review in the previous week. The most important points in the review are

1). Required a unittest for the new tagging class

     For this one I created a test named KoResourceTagging_test in libs/widgets/tests and it does all the unit test required for the tagging class. I tested all the functionalities of tagging class by taking various examples. And the testing helped me to find out two logical bugs. I solved them also. 😀

2). Interaction wise needs some improvement.

    The tooltips of the icons under the tagging lineedit are improved, so that they don’t seem to belong to the tagging process. This is the one change I corrected but still need to get reviews from users. So, that I can improve it better.;)

3). Nepomuk as another backend

    Many KDE people are asking the question ” why don’t you use nepomuk as backend ? ” For this, the only answer we have is ” we need compatibility with GIMP tagging system.” But afterwards we felt that ” why don’t we implement nepomuk as another backend along with XML ?”. Then Boudewijn Rempt suggested to go on in this direction and we started working . .

The plan for implementing this change is that

Whenever application is running, we will use tagObject (QMultiHash Object) for all adding, deleting and searching irrespective of backend. But at the time of storing or retrieving,there will be some change.

Just we will provide some option to the user, asking whether he uses nepomuk or XML ?

  • If user wants Nepomuk, we will store tags info by Nepomuk by adding two more functions : readNepomukRepo() and writeNepomukRepo() in KoResourceTagging class
  • If users wants XML , we will have the functions readXML() and writeXML already. we will use them

But I face some problems in implementing this idea ,

This is the code :

void KoResourceTagging::writeNepomukRepo()


  qDebug() << ” I am in ;”;

  QStringList resourceNames = m_tagRepo.uniqueKeys();

  qDebug() << “Resource Names List : ” << resourceNames;

  foreach(QString resourceName, resourceNames) {

     qDebug() << ” Resource name : ” << resourceName ;

     KUrl kurl(resourceName);

     qDebug() << ” Kurl : ” << kurl.url();

      Nepomuk::File resourceFile = Nepomuk::Resource(kurl).toFile();

      qDebug() << “Resource File Created : ” << resourceFile.url().url();

      QStringList tagNameList = m_tagRepo.values(resourceName);

      qDebug() << ” Tag names : ” << tagNameList;

      foreach(QString tagName, tagNameList) {

            Nepomuk::Tag tag( “ResourceTag” );


            qDebug() << “Tag Created “;

            resourceFile.addTag( tag );

            qDebug() << “Resources tagged “;




And the output for this is


# This one is the output of brush resourceServer when it called writeNepomukRepo()


I am in ;

Resource Names List : (“/home/legend/krita-build/inst/share/apps/krita/brushes/A-eroded-cercle-anim.gih”, “/home/legend/krita-build/inst/share/apps/krita/brushes/A-wall-texture.gih”)

Resource name : “/home/legend/krita-build/inst/share/apps/krita/brushes/A-eroded-cercle-anim.gih”

Kurl : “file:///home/legend/krita-build/inst/share/apps/krita/brushes/A-eroded-cercle-anim.gih”

Resource File Created : “file:///home/legend/krita-build/inst/share/apps/krita/brushes/A-eroded-cercle-anim.gih”

Tag names : (“a”)

QObject::startTimer: QTimer can only be used with threads started with QThread

Tag Created

Resources tagged

Resource name : “/home/legend/krita-build/inst/share/apps/krita/brushes/A-wall-texture.gih”

Kurl : “file:///home/legend/krita-build/inst/share/apps/krita/brushes/A-wall-texture.gih”

Resource File Created : “file:///home/legend/krita-build/inst/share/apps/krita/brushes/A-wall-texture.gih”

Tag names : (“bricks”)

Tag Created

Resources tagged


# This one is the output of pattern resourceServer. It ends with this error.


I am in ;

Resource Names List : (“/home/legend/krita-build/inst/share/apps/krita/patterns/choc_swirl.pat”, “/home/legend/krita-build/inst/share/apps/krita/patterns/java.pat”, “/home/legend/krita-build/inst/share/apps/krita/patterns/wood4.pat”)

Resource name : “/home/legend/krita-build/inst/share/apps/krita/patterns/choc_swirl.pat”

Kurl : “file:///home/legend/krita-build/inst/share/apps/krita/patterns/choc_swirl.pat”

Fatal Error: Accessed global static ‘Nepomuk::ResourceManagerHelper *instanceHelper()’ after destruction. Defined at ../../nepomuk/core/resourcemanager.cpp:310


I need help to solve this problem ? 🙂

Categories: Krita

Posted the review on Tagging in Krita

June 29, 2011 3 comments

Hi KDE Folks,

      I had finally completed the implementation part of tagging and then posted a review to merge it into the master branch. Now, I started working on the Sketchbook Tagging, which is my next part of the GSOC project :).

     Last week I did some code changes like

  • Changed the tagging Object from ItemChooser class to server class.
  • Added a function showTaggingBar(), so that the tagging bars can be individually enabled for the ItemChooser Objects.
  • Decreased some code in preset_chooser file.
  • Fixed the problem with resources that don’t have a filename, by adding some extra changes in the tagging object class.
  • Changed the comboboxes with KLineEdit instead of the Qt version. The KDE added some extra functionalities for the QlineEdit and created the class KlineEdit.
  • Fixed the problem that tags in the predefined brush chooser are not reset when a brush is set by a preset.

     After all the changes, the final GUI Look for tagging is like this . . .

     On the whole, I want all of you to test the tagging once and give me your comments :p . . .

Categories: Krita

Tagging is almost done . . !

June 21, 2011 4 comments

Hi KDE Folks,

     I am very happy to announce that Resource tagging is almost done for krita :). The basic functions like adding a tag, removing a tag, searching , storing and retrieving tags is already implemented and just in a few days, I will put the code for review. Remaining part – To verify whether I can decrease Code.

     Coming to working , This is the GUI for pattern resources

GUI for Tagging in Krita

     The upper combobox is for searching for a tag and below one is for adding and removing tags. Both are provided with autocompletion function by using Qcompleter class.

 For Adding Tag:

     First, we need click a resource, which we need to tag a resource. Then add/delete combobox is activated. If that resource already contains tags, then they are displayed, separated with ‘, ‘. Like this ” circle, round “. Then, we can type our tag name and press enter which will add tag for resource.

For Deleting tag:

      After selecting the resource, the tags will be displayed. Directly, we can edit the tag and press enter to delete the tags.

 For Searching resources :

     For searching, just enter the tag in the searchbar and press enter. It will display all the resources that are assigned with tag specified. We can refine our results by adding another tag also.

For storing and retrieving Tags:

     For storing and retrieving tags, we used XML file. The format of XML file is same as GIMP Tags.xml file, so that we can provide compatibility between these two. We will read Xml file at the startup and write them at the end.

 <?xml version=’1.0′ encoding=’UTF-8′?>

<!DOCTYPE tags>


<resource identifier=”/home/legend/krita-build/inst/share/apps/krita/paintoppresets/chalk.kpp”>




<resource identifier=”/home/legend/krita-build/inst/share/apps/krita/patterns/redcube.pat”>



<resource identifier=”/home/legend/krita-build/inst/share/apps/krita/patterns/rain.pat”>



<resource identifier=”/home/legend/krita-build/inst/share/apps/krita/patterns/bluesquares.pat”>



<resource identifier=”/home/legend/krita-build/inst/share/apps/krita/patterns/pool.pat”>




For Implementation:

     For this, we added separate file named KoResourceTagging.h and .cpp files in libs/widgets folder. These two files contains all the functions of Tagging. The GUI Part is implemented in KoResourceItemChooser.cpp file.

    We store the tags and filenames by using QmultiHash class and for autoCompletion, we used Qcompleter class and also QdomDocument class for the XML file.

 On the whole, tagging is implemented in Krita and open for further suggestions to make it more user friendly . . .

Categories: Krita

Tagging in Krita

June 6, 2011 2 comments

Hi KDE folks,

        I am so glad to announce that Resource management part of my project is completed 🙂 and it is successfully merged into the main branch. I started working on the tagging functionality and UI part. In this week, I created a post with my ideas of tagging and posted it in the krita’s mailing list.

Some of the main points in tagging implementation are

  • QMultiHash Object – it is the one which we are using for storing tags for the resources. These will help for storing multi values i.e. many tags for the same resource. The searching functionality is also done faster by using this one.
  • UI Part – It is still under discussion. We are observing the tagging system in various applications, to find a good and better one. We are planning to implement two separate UI’s. One for searching tags and other for adding/removing tags.

            Here, I’m again mentioning the point why we are not using nepomuk because we want a tagging system which is compatible with the GIMP Tagging system. We need compatibility, so that we can exchange resources and tags easily.

Categories: Krita

Finishing Touches to Resource Management in Krita

May 30, 2011 2 comments

Hi KDE Planet,

       In this week, I prepared platform for doing next objective in my project i.e. tagging and also adding some finishing touches to the resource management part. I posted a review to check my present working branch “krita_resource-management-tagging-tiyyagura”, so that I can merge the branch into the master.

       I faced so many problems while building gimp on kubuntu Natty. I followed various tutorials and end up in errors. But this one is good, you can refer that when you want to build gimp in ubuntu.

        Coming to Resource management part, I changed the code of some functions in my commits, where I think there is a chance for decreasing the code. I updated the icons of the buttons in the GHNS Tool bar as suggested by pentalis and bugsbane. Still, I didn’t find a good icon for sharing resources. There is also no perfect icon in any application which represents uploading something (some icon designer can help by creating a new one 🙂 ).

And finally with these changes, I tried posting the review with post-review command but it is giving error like this

  File “/usr/lib/python2.7/”, line 809, in _send_output

  msg += message_body

  UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc5 in position 44353: ordinal not in range (128)

What may be the error ?

       I didn’t solve this error and so, I created a diff file between master and krita_resource-management-tagging-tiyyagura branch and posted that for review. Bowdewijn Rempt and Elvis stanswik already reviewed the code and suggested some changes. I did them, waiting for further suggestions and eager to merge the branch into master.

Categories: Krita

Resource Management for Presets in Krita

May 24, 2011 3 comments

Hi KDE Community,

I am glad to say that Resource management functionality is successfully added to presets resource :). Now its time to add this functionality to other resources in Krita :-/. The work I did in this week given me a lot of confidence and interest to do more.

1) A Bug fix

Firstly, I am thankful for Dave, cloose and JanKusanagi for there advice in fixing .knsrc file. With Daves comment, I thought of different distros and I asked Sven, about this one. He said that he noticed a bug in this issue and need to fix it. Then with cloose comment, I used the TargetDir instead of InstallPath with some modifications. Finally, it is fixed.

2) Blacklisting default resources

This functionality will come into stage when user want to delete default resource. The default files are not deleted but hidden from user by using blacklist file. Here, we added file names in an XML file and at startup, by using this XML file, we avoid to load these resources.

3) Changing resources

Whenever a user need to change a resource, then he can change the resource properties and then saves the resource file. This functionality is there already but changed a little bit.

4) Need Suggestion


These are buttons explanations

  • GHNS Upload button – It is the GHNS button, which executes the download widget of GHNS.
  • GHNS Download button – It is also the GHNS button, which executes the upload widget of GHNS.
  • Add Button – It helps to install the files which are downloaded directly without using GHNS.
  • Remove Button – This one removes the resource from the docker.

At remove button, we are facing the problem. The problem is

1). Whenever we installed some files using GHNS, the installed files are showing uninstall button in ghns dialog,

2). Now we remove these files using remove button.

3). And then we open GHNS dialog, the files which are removed using remove button are still showing uninstall option only.

Here, if we remove the files using remove button, the status of these files in cache registry are not updated. How can I do this thing ?

When I asked Frederik Gladhorn about this, he said to use the get hot new stuff api i.e. downloadManger to remove items. ( ). But for using this class, we need entry object, which is not available here.

On the whole, this week work gave me satisfaction and I will do more in upcoming weeks 🙂

Categories: Krita

Enhancements in Krita GHNS Utility

May 16, 2011 4 comments

Hi Kde Community,

 In this week, I interacted with my mentor more and learned some new issues and committed two commits for GHNS.

 1). commit – 6cd1bbf92cdd0259d7a220ff4c9dc8a848947afb

 After downloading the resources using GHNS, they are not updating automatically in the docker section. This commit solves the problem by introducing a new function named “loadingResourceFile()” in libs/widgets/KoResourceServer.h. This function creates a resource using the downloaded file and adds it to the Resource server, which helps to upload the function.

 2). commit – f4e5d3a75008a93e25fc0b3491130fb84c357ef7

 In GHNS download dialog, once we select uninstall the resources, the resources are need to remove in docker but they are not updating. In this commit, this one is solved by using the above commit logic only.

Pic which shows the GHNS Dialog

 3). Thing I didn’t understand.

 -> While GHNS is running, it is giving the wrong address of the downloaded file

 Ex: /home/legend/.kde/share/apps/krita/paintoppresets//141694-TestPreset2.kpp — this one is the output address.

It should look like this /home/legend/.kde/share/apps/krita/paintoppresets/141694-TestPreset2.kpp.

here InstallPath = /home/legend/.kde/share/apps/krita/paintoppresets

FileName = 141694-TestPreset2.kpp

So, I think while joining these two, something is wrong. I didn’t getwhere this code is ?

 -> Another task is I didn’t get where GHNS is loading the status of the installed files. This one is used to remove files using remove button in the docker.

 I will fix these things as soon as possible. But this week, I enjoyed a lot in working with my mentor. 🙂

Categories: Krita