Posts about technology and arts.

Drawing Santos Dumont's "Encantada" in Krita

A Encantada

With Krita 4.x released, and the Krita monthly challenge of May still open for submission, I decided to give it a go and try this new version to create an artwork to for the challenge. The topic of this month’s challenge is Home.

My submission was Santos Dumont’s house in Petropolis, Rio de Janeiro, called Encantada.

And I am happy to report that Krita 4.x looks much faster! And I had no crashes, bugs, nor any lags while painting.

Santos Dumont built this house to be his home away from the big city, while also being able to keep some of his inventions nearby, and work on other projects. It was a space to be creative!

I started by preparing the canvas with the original image and an onion layer, and then traced the lineart. I used David Revoy’s brushes. They are great! And used the built-in chalk brush for most of the colours.

Line art

I enjoy line art much more than colours, but for the monthly challenge, I tried to use some colours. I used the original photo to create the palette for the painting.

Line art

It had been a few months since I used either my Wacom tablet or Krita for painting. But I was glad to remember some shortcuts. Krita interface is also quite intuitive. In a few minutes I found how to rotate the canvas and the zoom controls.

Below a few more screenshots. If you are interested, submit your artwork to the Krita monthly challenge too! Or if you are not using Krita yet, spend some time using it to compare with other editors.

I am sure you will be glad with the results.

Screen shot

Screen shot

Screen shot

Screen shot

Screen shot

Oh! I also need to find some more time another day to try the newly released Krita’s Python scripting!

♥ Open Source

Trivia #1: I grew up on the North of Sao Paulo city, near an important avenue called Dumont Vilares. It gets this name after Luís Dumont Vilares, main name of Atlas Elevators, and brother of Santos Dumont. Very few people are aware that this avenue is related to the inventor.

Trivia #2: the house is called “A Encantada”, which means Enchanted (feminine). It gets this name because of the name of the street where it was located: Enchant Street, or Rua do Encanto in Portuguese.

Learning more about SPARQL and Jena internals

O Corvo
O Corvo

Recently a pull request for Apache Jena that I started three years ago got merged. Even though it has been three years since that pull request, there are still many parts of the project code base that I am not familiar with.

And not only the code, but there are also many concepts about SPARQL, other standards used in Jena, and internals about triple stores.

The following list contains some presentations and posts that I am reading right now, while I try to improve my knowledge of SPARQL and Jena internals.

R Shiny + Ansible =

R Shiny + Ansible =

R Shiny + Ansible =
Where ?
Auckland, New Zealand
When ?

Exif Odd Offsets

A file format like JPEG may contain metadata in JFIF, Exif, or a vendor proprietary format. The Exif format is based - or uses parts of - on the TIFF format.

Within an Exif metadata block, you should see directories, with several entries. The entries have fields like description, value, and also an offset. The offset indicates the offset to the next entry.

The Exif specification defines that implementers must make sure to keep the offset an even number, within 4 bytes.

I recently worked on IMAGING-205, a ticket about odd offsets in files with Exif metadata. This issue was exactly to address that when files were rewritten with Apache Commons Imaging, even though the image initially had no odd offsets, after the entries were rearranged, we could have odd offsets.

The fix was simply checking for odd offsets, adding +1, and later it would be put within the 4 bytes limit.

A screen shot of Eclipse with source code
Locating the bug

One interesting point, however, is that this is in the standard, but not all software that read and write Exif follow the specification. So it is quite common to find images with odd offsets.

Which means you could take a picture with your phone, that contains some Exif metadata, and be surprised to analyze it with exiftool and get warnings about odd offsets. Most viewers handle odd and even offsets, so it should work for most cases, unless you have a strict reader/viewer.

Happy hacking!

&heart; Open Source

Remember to synchronize when iterating streams from a synchronized Collection

When iterating collections created via Collections.synchronizedList for instance, you are required to obtain a lock on the actual list before doing so. So you normally end up with code similar to:

List list = Collections.synchronizedList(new ArrayList());
synchronized (list) {
  Iterator i = list.iterator(); // Must be in synchronized block
  while (i.hasNext())

This requirement is documented in the javadocs.

Since lambdas and streams are being more widely used, it is important to remind that when iterating via a stream we also need to obtain a lock on the synchronized collection created.

List list = Collections.synchronizedList(new ArrayList());
synchronized (list) {

Here’s an example from Zalando Nakadi Event Broker.

Happy hacking!