After looking for a long time on the internet I could not find a real solution for my "problem". 

---

**What I want to do:**

Compare 2 images (created with the Raspberry Pi camera in a Python script) in C.
I have tried this in Python but it is too slow (+/- 1 minute per 2 images).

So I would like to try it in C. I call a C function with ctypes from my Python script. The C function expect to get 2 strings containing the paths of the 2 images. The C function must return a double variable (percentage of difference) back to the Python script. 

---

**What I tried:**

I store the images as .JPG, so I searched for a c-library that can handle the jpg-format. I found a post here on stackoverflow advising CImg. I could not get that to work on my Raspberry Pi. Said it could not find the imports.

```
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "cimg/CImg.h"

using namespace cimg_library;

double compare_pictures(const char* path1, const char* path2);

// Compares two Pictures and returns the difference value
double compare_pictures(const char* path1, const char* path2)
{
    CImg<unsigned char> image1(path1);
    CImg<unsigned char> image2(path2);
    double totalDiff = 0.0;
    unsigned int x, y;

    if (image1 == NULL || image2 == NULL)
    {
        fprintf(stderr, "One of the images does not exist\n");
        return -1;
    }

    if ((image1.width() != image2.width()) || (image1.height() != image2.height()))
    {
        fprintf(stderr, "width/height of the images must match!\n");
        return -1;
    }
    else 
    {
        for (y = 0; y < image1.height; y++)
        {
            for (x = 0; x < image1.width; x++)
            {
                totalDiff += fabs((int)image1(x, y, 0, 0) - (int)image2(x, y, 0, 0)) / 255.0;
                totalDiff += fabs((int)image1(x, y, 0, 1) - (int)image2(x, y, 0, 1)) / 255.0;
                totalDiff += fabs((int)image1(x, y, 0, 2) - (int)image2(x, y, 0, 2)) / 255.0;
            }
        }
        totalDiff = 100.0 * totalDiff / (double)(image1.width() * image1.height() * 3);
        printf("%lf\n", totalDiff);
        return totalDiff;
    }
}

```

> 
> CImg.h:73:18: fatal error: cstdio: No such file or directory.
>  compilation terminated.
> 
> 
> 

After some tries I gave up and went back to the internet to find another library. I found libjpeg8-dev which is suitable for the Raspberry Pi and C. Nonetheless this did not help me much either, because I couldn't really find good tutorials/documentation how to use it for my purposes.

---

I just want to be able to compare images created by the Raspberry Pi camera and calculate a difference percentage in a fast way (best would be in less than a second)
['https://Stackoverflow.com/questions/26911620', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2289964/']
To use Coveralls with Gradle and Travis, I'm using the Coverall's Gradle plugin ([com.github.kt3k.coveralls](https://github.com/kt3k/coveralls-gradle-plugin)) and a command after success in Travis.

The plugin's readme explains its usage pretty well. But if you want to check an example, you can refer to the project in which I'm using it: [Sabina Java](https://github.com/jamming/sabina)

The relevant files are: `.travis.yml` and `build.gradle`

Just a hint: you can enable logging in Travis adding the `--info` flag in the commands to help you spot the bugs.

I hope this would be of any use after such a long time.
I also got this error (*Couldn't find a repository matching this job.*) when I specified a repo token. The Coveralls documentation suggested to specify a repo token, but didn't make it clear enough to me that you *must not* specify a repo token if you're using public repos.

In other words, if your stuff is public on GitHub and on Coveralls, don't specify a repo token, or you'll get this error.