URL creation

Bitmap hashing

A key aspect for Happo is the ability to quickly diff two image snapshots purely based on the URL to the image. If the URLs aren't equal, we assume the two images are different. If you end up using the Happo API directly, you are responsible for providing bitmap-unique URLs when you upload reports. If you use the Happo client, this is automatically taken care of.

Based on the raw image bitmap, generate a deterministic hash string and use in the URL to the image. Happo uses the md5 algorithm internally, but you are free to use any hashing function.

Apart from helping Happo diff images faster, bitmap-unique URLs will help keep the snapshot-storage size down by not saving duplicates.

CORS settings

Happo does in-browser diffing of your images. For this to work, the images uploaded in your report must be served with an Access-Control-Allow-Origin CORS header, granting access to the happo.io domain (or your custom domain if you have a different setup).

If you use Amazon S3 storage, this article on CORS is helpful: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html