Image

digiKam GSoC 2018

Me and Tarek

It was really nice working with Tarek on GSoC 2018 project with KDE. Tarek did a good job supporting new export tool for digiKam so users can upload their local images to more web services. check his work report here

The photo was taken by the art awesomeness symbol Heba Attwa

Image

digiKam GSoC Students in Egypt

20049194_10209549565355868_878047986_o

Me, Shaza, and Ahmed

It was nice meeting Ahmed and Shaza @ faculty of Engineering, Ain Shams University in Cairo. I am proud to mentor them in Google Summer of Code.

Ahmed is working on implementing a DLNA server in digiKam core to export photo and video hosted in physical and virtual collections. The server is ready and he working on the configuration panel UI. See more here.

Shaza is working on a tool for image editor to be used for healing image stains with the use of another part of the image by coloring by the use of one part over the other, mainly testing on dust spots, but can be used for other particles hiding as well. See more here.

Link

PyQt 5 and QWebEngine

I stumbled upon a problem when I was working my graduation project and tried to create a QWebEngineView to put a simple HTML code and listen to click events on some tags.

The problem was that I wanted to run some python code when someone clicks on a button, I didn’t find any obvious examples on this, So I wrote a question on a stackoverflow and but sadly no one responded.

I kept struggling until I got everything working and at the very first time I answered my own question.

Here is the link of the question on stackoverflow:
http://stackoverflow.com/questions/40821700/qt-5-7-qwebengineview-connect-html-button-click-event-to-c-qt-slot

Link

My Zsh Theme

screenshot-from-2016-09-29-20-13-37
My Zsh theme – Forked from Gnzh theme
The theme shows:
– Time
– Path
– Currently used Ruby Version + Gemset (RVM needed)
– Git repo branch + status (Must be inside a git repo)


setopt prompt_subst
() {
local PR_USER PR_USER_OP PR_PROMPT PR_HOST
# Check the UID
if [[ $UID -ne 0 ]]; then # normal user
PR_USER='%F{green}%n%f'
PR_USER_OP='%F{green}%#%f'
PR_PROMPT='%f➤ %f'
else # root
PR_USER='%F{red}%n%f'
PR_USER_OP='%F{red}%#%f'
PR_PROMPT='%F{red}➤ %f'
fi
# Check if we are on SSH or not
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then
PR_HOST='%F{red}%M%f' # SSH
else
PR_HOST='%F{green}%M%f' # no SSH
fi
local return_code="%(?..%F{red}%? ↵%f)"
local user_host="${PR_USER}%F{cyan}@${PR_HOST}"
local curr_t='%B%F{green}%t%f%b'
local current_dir="%B%F{blue}%~%f%b"
local rvm_ruby=''
if ${HOME}/.rvm/bin/rvm-prompt &> /dev/null; then # detect user-local rvm installation
rvm_ruby='%B%F{red}‹$(${HOME}/.rvm/bin/rvm-prompt i v g s)›%f%b'
elif which rvm-prompt &> /dev/null; then # detect system-wide rvm installation
rvm_ruby='%B%F{red}‹$(rvm-prompt i v g s)›%f%b'
elif which rbenv &> /dev/null; then # detect Simple Ruby Version Management
rvm_ruby='%B%F{red}‹$(rbenv version | sed -e "s/ (set.*$//")›%f$b'
fi
local git_branch='$(git_prompt_info)'
PROMPT="╭─${curr_t} ${current_dir} ${rvm_ruby} ${git_branch}
╰─$PR_PROMPT "
RPROMPT="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%B%F{cyan}("
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}) %{$fg[green]%}±%f%b"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})%f%b"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
}

digiKam | GSoC 15 the summary

3a9b0-digikam_logo

I know it’s been too long, I should have written something about my GSoC project with digiKam and how it was going, But actually I was too busy discovering new parts of digiKam source code, By the way, the source code of digiKam is not small it’s 1,079,949 lines of code and increasing every day, also most of my work was away from GUI, so I had no screenshots 🙂

My project was about increasing the performance, portability, and reliability, the project goal was to drop all KIO-Slaves which were created to do DB calls in a separate process and get the results to digiKam app, But why would we drop them if they were working just fine, here is why:

  • They were creating some malfunctions on Windows, so they affect the portability
  • They need data serialization, So you see data converted to QByteArrays everywhere in the code, Which was creating some performance issues
  • KIO-Slaves are working in separate processes, Which were impossible to debug and fix

Now the new implementation is thread based, and everything is done in a single thread, No data serialization anymore, and everything is faster.

Also, the project intended to create a safe way to isolate KIO implementations everywhere in the source code which represents in big part in the code, So I created a wrapper called KIOWrapper, which holds every single file include and method call related to KIO in it, But why isolating them?!, Simply now we can create a CMake flag to make digiKam a pure Qt implementation.

But wait a minute, How can we now do stuff with file system like copy and delete when KIO implementation is isolated and turned off, Simply I created a new thread based implementation to do all IO jobs, like file deletion for example, Just mark a bunch of images in digiKam view, right click on one, then press delete, Now you are creating a number of jobs (tasks) equal to the number of images, and those jobs get appended to the jobs que.

The best part of the project

It was a surprise for me too 🙂 , When I was wrapping KIO code, I found some code which was meant to handle deleting files to trash, So I had to create an equivalent trash implementation, But my mentor Gilles Caulier suggested creating a special trash implementation for digiKam, So there will be a trash for every image collection, Here is a screenshot to illustrate my words

digiKam_012

As you can see in the screenshot there is a separate virtual album to see items in your trash for this collection and this album is added for every collection you have on you computer, also, you can see a nice table view showing the relative path which represents the place the image will be restored to, and of course you see the deletion timestamp,

Of course, you can discover everything about it intuitively from the screenshot, Have fun!

Randa Meeting 2015

There is a lot of work to do and a lot of surprises to reveal, Specially when it comes to Android 🙂 , This year digiKam team will attend the Randa meeting to meet up together trying to do their best to introduce Android ports for digiKam,

To learn more about the event please check this link, and don’t hesitate to donate to make this really happen, Thanks in advance.