Cookbook for libjpeg