Tobias Watzl

Programmer, photographer, engineer.

Tobias Watzl

4-Minute Read

With this post I am testing the image hosting capabilities of my blog software.

It took me quite a while to figure everything out. I started this post on August 24, 2019, but couldn’t finish my work on it until now. The main reason was that there was some issue with my test system and I also had much to do with work and my bachelor thesis.

I am using hugo-easy-gallery for displaying my images. The infrastructure behind my pictures is also notable.

When I set up this blog I have decided that I want to make it stateless. What does that mean? Like with a docker container I want to be able to move it from one provider to another within minutes, be able to recreate it anytime from scratch etc. The way I currently archieve this is by having a git repo where all the posts, pages etc. are stored and another repo where docker-compose files and scripts are checked in which make up the infrastructure of my blog.

Whenever I create a new post I have a script which renders my page using hugo and pushes the contents to the git repo. On the server I then run a script which pulls the newest version. However as you might know you should not put binary or large files in git repos. Unfortunately pictures are both: binary and large.

So how did I solve this problem? I have a personal Nextcloud instance running which I use for my photography stuff. So I decided to write a WebDav client in Go which can recursively download a directory. I created a special user on my Nextcloud and share a “Blog” folder with it. On the server I then run the tool which recursively downloads the directory from Nextcloud.

The reason I implemented the tool myself is, that it seems that there is no tool available which can do it. After managing to get around the xml issues I was really quick and it only took me two evenings to develop this. You can find the tool here in case you have use for it: https://github.com/twatzl/webdav-downloader.

So what can I do with the gallery?

First I can include selected images within the text using the following code:

{{< gallery >}}
	{{< figure src="/img/Blog/2019-08-19_image_test/2019-03-05_11-51-55_NIKON D90__DSC0043.JPG" >}}
{{< /gallery >}}

Another option is to include a directory

{{< gallery dir="img/Blog/2019-08-19_image_test" >}}
{{< /gallery >}}

However I still have to find a way to add captions in that case and I will probably also shorten the names of my pics.

Some might ask why I watermark my images. In my opinion a watermark is the easiest way to prevent the stupidest people from just copying my pictures. I have seen it often enough that people just copy pictures to Twitter or somewhere else. In that case it is then easy for me to prove that the images are mine. It is often argued that a watermark can be easily removed. However I think there are enough people who do not know how to do that or are simply too lazy to do that.

If you want to use one of my pictures please don’t hesistate to contact me via mail to twatzl-blog@gmx.at or via Twitter @TobiasWatzl and I am sure we can find an arrangement.

Recent posts

Categories

About

Blog