All posts by Christian Stocker

Compare and convert HEIF, JPEG and WebP images with rokka

TL;DR

Go to https://compare.rokka.io/_compare/ and compare the output of the HEIF, JPEG and WebP formats. Even upload your own pictures. All done with rokka.

Long version

Apple produced quite some hype with their support for the HEIF image format in the upcoming iOS 11 and macOS High Sierra. HEIF (High Efficiency Image File Format) is a new image file format, which supports many use cases and uses HEVC for the compression part, also known as H.265. Apple is using HEIF on their latest devices as a replacement for storing pictures and claims up to 50% saves on storage.

Even though no browser does support HEIF yet, also not Safari in the current betas, we nevertheless thought it would be cool to add HEIF support to rokka – our image storage and delivery service. And so we did.

Unfortunately there’s no out-of-the-box solution to create HEIF files currently. But Ben Gotow‘s site jpgtoheif.com inspired us. He published instructions how to create HEIF files with the help of ffmpeg, x265 and Nokia’s heif writerapp. But due to the uncommercial-only license of that Nokia code, we use GPAC to create the HEIF container, which is published under the LGPL license.

Looking at and comparing HEIF compressed images

What’s the fun, when almost no one can look at the result? So we built a little site, where you can compare the output of rokka’s HEIF, JPEG and WebP (the later is only supported on Chrome) and even upload your own pictures. Just head to

https://compare.rokka.io/_compare/

and enjoy it. The uploaded images will be deleted from time to time.

The site uses Nokia’s HEIF Reader JavaScript Implementation, which decodes a HEIF image in JavaScript to a canvas element. This way, everyone can look at HEIF images and compare them to JPEG and WebP output.

The site also allows you to play with different quality settings. All formats support a setting from 1 to 100. 1 is the lowest and 100 the highest (also means lossless for WebP). The different quality settings for the different formats don’t really correspondent to each other. Just play around with them and compare the sizes of the images with different settings.

We use pretty much the default settings of ffmpeg, maybe some stuff could be improved on that side. And we also don’t know what kind of encoder Apple is using for generating HEIF images. So don’t really compare the compression we produce for HEIF images with what maybe other encoders can do.

Also be aware, that we asynchronously compress JPEG images in the background with mozjpeg (see the rokka docs for details), so the first render output is not the maximized compression we can get for JPEG images. Just hit the render button 10 seconds later to get the final compression (the site will inform you, when it’s not done yet with that compression step).

Tags: , , ,

rokka got some new features

Rokka – our image storage and delivery service, got quite some new features lately, thanks also to feedback from our users. Here’s a list of the visible stuff we did.

Brandnew this week

  • autoformat. A new stack option. If set, rokka will return WebP, if the client supports it and a PNG or JPEG was requested, resulting in smaller images.
  • dpr. Device Pixel Ratio. Another new stack option. If set, returns higher resolution images, useful for <img srcset="" /> for example.
  • Width or height are finally optional in the resize operation.
  • The WordPress plugin got some improvements.
  • Work for a Drupal 8 module and a Kirby plugin are under way.
  • General improvements in performance, failover cases and small bugfixes.

    Continue reading about rokka got some new features

Tags: , , ,

No nginx basic auth with either network or cookie set

For an internal tool, we’d like to allow access if you either coming from one of our office networks or you have a certain cookie set. If both are not satisfied, just show the usual basic auth dialog. And set that cookie, once you were allowed to access the page.

We wanted to do that in nginx and not the tool itself, as it looked like easier to do, especially since the tool didn’t have any authentication at all yet. Unfortunately it wasn’t that straight forward, but we found a working solution and wanted to share that.

Hope it helps anyone and saves them some time.

PHP 7.0.0 for OS X and CloudFoundry

Update: Since 7.0.0 is officially out, we updated our binaries as well with the final release.

PHP 7.0 is very very near, if no showstoppers show up during the current Release Candidate #8. And I finally managed to update the package on php-osx.liip.ch, so that you can test and start writing applications on your local OS X machine easily, as well. The installer also automatically does the right thing in the apache configuration with regards to “mod_php7” and “mod_php5”.

Furthermore, since we are using CloudFoundry in one of our bigger projects, I also extended the official PHP buildpack to include PHP 7.0 (and some other things like varnish, but that’s not relevant for this). This way we can easily see, if our apps still work with PHP 7 and do some benchmarks (the initial ones looked promising). To use the buildpack, add the following line to your manifest.yml

and adjust .bp-config/options.json to include (and maybe also change your composer.json to use PHP 7)

Be aware, that I didn’t port many of the extensions the official buildpack includes, so your milage may vary. And if you want to be sure it’s thoroughly tested, maybe better wait for official PHP 7.0 support in the CloudFoundry buildpack. I’m sure, they won’t wait long once it’s is released.

There’s now no excuse anymore to not test your apps against PHP 7.0

Tags: , , ,

Self managed companies in Switzerland?

“Self-managed companies” or “teal organizations” are a hot topic in many circles. Especially the books “Reinventing Organisations” and “Holacracy” are among the bestsellers in that area.

We at Liip try to be somehow self-managed since quite some time, it comes quite naturally with being agile. Teams (between 5 and 20 people) can decide a lot by themselves already. But of course, there’s still a management on top, which decides about company wide things and also not so company wide things. We now started an active discussion within the company (for example with a session at the last LiipConf) about how it could work, without such a central, top-down management. We haven’t figured out the details yet, but we’re very eager to try.

But we’re also very interested to get to know people who are already doing that or also want to try it. So, please get in contact with me, if you’d like to meet.

To get an idea, what I personally mean with “self-managed company”, here are some questions. If you can answer them with yes, you’re pretty self-managed (in my opinion)

  • Does your company not have a top-down management?
  • Do you have no hierarchy and fixed roles, especially not through job titles?
  • Can people in your company decide on their own without approval from someone “higher up”? Also for investments?
  • Are there no fixed budgets defined from above/centrally?
  • Do people decide about hiring and firing?
  • Do people even decide about their salary?
  • Are you more than “just the founders”? (not sooo important, but maybe for a future growth of your company)
  • Do you have a process to solve conflicts, so that not the one with the bigger voice always wins?
  • Can anyone take responsibility where they want? Define their own roles?
  • Don’t you always try to find a consensus while not trying to please everyone?
  • Do you trust everyone in your company that they take the right decision at that current time?

One important thing in all this is, that “decide on their own” doesn’t mean, they can just do whatever they want or what feels right. There are many different ways to approach this, but the most important part in all of them is, that you have to get advice from the others before deciding something.

I’m really looking forward to the discussions

Tags: , ,

“Time for Coffee!” open sourced!

The public transport app “Time for Coffee!”, made by some Liipers, was finally published at Github under the MIT License. Furthermore the Apple Watch app for it was also released last week, just in time for the watch release in Switzerland this Friday.

Read more about it at the Time for Coffee! blog post.

Tags: , ,

This blog is now faster than ever

After we changed silently to using WordPress a few weeks ago for this blog (from the ageing Flux CMS software), we now also upgraded the server software to the latest and greatest versions. We finally use HHVM 3.6, nginx with SPDY 3.1 support, deliver everything in SSL only (but of course redirect from port 80), updated our certificate to use SHA256, disabled all “known-as-weak” ciphers and protocols (sorry IE 6 users), do OCSP Stapling and even send an HSTS header for being extra secure. We also switched to a server not on the edge of the continent anymore and deliver it additionally via IPv6.

With all that, this site should be faster and more secure than ever. Enjoy!

(We also applied the SSL/SPDY settings to www.liip.ch, so you may enjoy a better experience there as well)

Tags: , ,

Time for Coffee for iOS and Apple Watch

Jan Hug, Cyril Gabathuler and myself worked hard in our free time the last few weeks on an iPhone app for the great website timeforcoffee.ch, a private project started by François Terrier and his friends Serge Pfeifer, Jean-Luc Geering and Kristina Bagdonaite. It also has newly addded support for the upcoming Apple Watch. As this is a project done by Liipers and non-Liipers alike, we talk about it more on medium.com, go and read it! And apply for the beta and follow us on twitter: @time4coffeeApp

Tags: , , ,

New Relic extension for HHVM updated to latest version

Since I first published my New Relic extension for HHVM, I didn’t do much and we stayed on that HHVM version (3.1). A lot changed in HHVM, which was one of the reasons I didn’t do much: Too many changes in there, but it was for the good.

(Soon) no HHVM recompling needed anymore

Since HHVM 3.4 it’s theoretically possible to have your own external profiler for function level profiling (like xhprof or xdebug) without having to recompile HHVM itself. Unfortunately it wasn’t perfect (or I couldn’t make it running), but there’s a patch in the master branch now (the upcoming 3.6), which seems to solve that problem. So I worked a little bit on my extension in the last few days and I adjusted a lot of things and improved some other stuff.

Continue reading about New Relic extension for HHVM updated to latest version

Tags: ,

php-osx available for OS X 10.10 Yosemite

Apple released OS X Yosemite as a public beta release last week and it of course comes with updated utilities, eg. Apache httpd 2.4 and PHP 5.5

Since httpd 2.4 is not API compatible for modules, the php-osx packages didn’t work and we needed to recompile the packages. That’s what I did and now you can install php-osx also for OS X Yosemite with the usual simple command.

I couldn’t compile libmemcached yet, will try to figure that out when everything settled a little. Also the iodbc extension had some problems, so that’s not in the package yet.

There was also a compile problem with 5.3, so that’s not available yet for 10.10

With all this, I have some questions about future support of all the possible versions:

  • Are you still using OS X 10.6/10.7 and would like to have updates on those platforms?
  • Do you need upcoming PHP versions like 5.6 on 10.6/10.7?
  • Do you need PHP 5.3 on OS X 10.10 (Yosemite)?
  • Do you need iodbc?
  • Anything else missing?

If you answer one of those questions with yes, please leave a comment (I also will analyse the logs to see how many times the different versions are downloaded). Or file an issue on the github project. We won’t remove any of the available packages today, the question is more about future support and if it’s worth to put some effort to eg. get PHP 5.3 running on 10.10 or PHP 5.6 on 10.6/10.7 (both currently fail for me)

You can also see what PHP version we support for what OS X version and when we last updated it at the bottom of php-osx.liip.ch. And if you didn’t notice, we also have packages for PHP 5.6beta since quite some.

Having said all that, we at Liip mostly use vagrant boxes nowadays, our operating-systems-used landscape got much more diverse and it’s much easier with vagrant to ensure a common working environment on all systems. Stuff like imagemagick is also much easier to install in a linux vagrant box and HHVM anyway (where the support on OS X is quite limited right now. It works, but still a little bit of a pain, homebrew on the other hand helps a lot as well in this regard)

Tags: , ,