New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JPEG parameter struct mismatch: library thinks size is 656, caller expects 624 #175
Comments
Hi @agboom Please, to verify this, try using one of the python examples to make sure the error is there. This one in particular performs the same procedure as our application:
Check this, and then try to help you compile it again. |
Thank you for your suggestion @matiasdelellis, I ran the python example and it works fine. I also built dlib using the build parameters in this Dockerfile, hoping that it would make a difference, but sadly it did not. Not sure where to go from here 🤔 |
We are logging more detailed error when debug is enabled. Can you run it with
Can you elaborate on this? You are refering to dlib's and pdlib's sources? How did you compile dlib and pdlib, anything different than what is written in here: https://github.com/matiasdelellis/facerecognition/wiki/Installation. Also, what OS/version you are having, in case I want to repro? |
Thanks, @stalker314314. Running with
I'm indeed referring to dlib's and pdlib's sources. I compiled them in Alpine using the instructions in the Wiki page you linked, except the names of the Alpine packages are a bit different (see below). The Nextcloud instance is running in a Docker container installed, so I'm building in Docker environment. Until now I tried various ways of building the libraries:
The Dockerfile to build dlib and pdlib is as follows: FROM alpine
RUN apk update && apk add bash vim git
# DLib https://github.com/goodspb/pdlib#dependencies
RUN apk add cmake make gcc libc-dev g++ openblas-dev libx11-dev pkgconf
RUN git clone https://github.com/davisking/dlib.git \
; cd dlib/dlib \
; mkdir build \
; cd build \
; cmake -DBUILD_SHARED_LIBS=ON .. \
; make \
; make install
# https://github.com/goodspb/pdlib#installation
RUN apk add php7-dev
ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig/
RUN git clone https://github.com/goodspb/pdlib.git \
; cd pdlib \
; phpize \
; ./configure \
; make \
; make install |
Hi both,
Look carefully at the log of this command to know if you are using libjpeg, version, etc.. If you want share it. |
@matiasdelellis It says Which is right, because libjpeg is installed via the package manager using This is (part of) the log of
Could it be that |
This comment has been minimized.
This comment has been minimized.
Well, The dockerfile you shared does not include these lines. 😅
There are few changes but you can try to compile the stable version instead of git |
p.s: davisking/dlib#1913 |
Well .. It seems that I have a dokerfile that seems to work..
This runs a test that was originally for issue #140 and it works correctly
|
Thanks for the elaborate follow up @matiasdelellis!
You're absolutely right, I made a mistake here, mixing up two different Dockerfiles. The observation is still right, but I failed to say that the output in that comment (where libjpeg is found as system copy) was a result of building another Dockerfile where jpeg and jpeg-dev were indeed installed. Sorry for the mixup 😅 I'm now trying your Dockerfile to see if it makes a difference. Will tune back with the results 🤞! |
Your Dockerfile works, so that's great! The tests you included run fine. A little out of scope for this issue, but is it expected behavior that the
|
As an addition, I've created a Dockerfile with multi-stage build for building dlib, pdlib and the facerecognition app. This may be useful for fellow Docker users, so if you like we could add this to the documentation of this app for easier onboarding? This is all largely out of scope for this issue, so I'm willing to create a new issue or even a PR if you'd like. The Dockerfile: FROM alpine AS builder
# DLib https://github.com/goodspb/pdlib#dependencies
RUN apk add cmake make gcc libc-dev g++ unzip openblas-dev libx11-dev pkgconf jpeg jpeg-dev libpng libpng-dev
ARG DLIB_BRANCH=v19.18
RUN wget -c -q https://github.com/davisking/dlib/archive/${DLIB_BRANCH}.tar.gz \
&& tar xf ${DLIB_BRANCH}.tar.gz \
&& mv dlib-* dlib \
&& cd dlib/dlib \
&& mkdir build \
&& cd build \
&& cmake -DBUILD_SHARED_LIBS=ON --config Release .. \
&& make \
&& make install
# https://github.com/goodspb/pdlib#installation
RUN apk add php7-dev php7-gd
ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib64/pkgconfig/
RUN pkg-config --libs --cflags libjpeg \
&& pkg-config --libs --cflags dlib-1
ARG PDLIB_BRANCH=master
RUN wget -c -q https://github.com/goodspb/pdlib/archive/$PDLIB_BRANCH.zip \
&& unzip $PDLIB_BRANCH \
&& mv pdlib-* pdlib \
&& cd pdlib \
&& phpize \
&& ./configure \
&& make \
&& make install
RUN apk add npm bash make composer curl wget php7-dom php7-tokenizer php7-xmlwriter php7-xml
ARG FR_BRANCH=master
ADD busybox.patch .
RUN wget -c -q -O facerecognition https://github.com/matiasdelellis/facerecognition/archive/$FR_BRANCH.zip \
&& unzip facerecognition \
&& mv facerecognition-* fr \
&& cd fr \
&& patch -uN < ../busybox.patch \
&& make
ARG NC_VERSION=17
FROM nextcloud:$NC_VERSION-fpm-alpine
RUN apk add jpeg libpng php7-gd openblas
COPY --from=builder /usr/local /usr/local
COPY --from=builder /usr/lib/php7/modules/pdlib.so /usr/local/lib/php/extensions/no-debug-non-zts-20180731/
COPY --from=builder fr /var/www/html/apps/facerecognition
RUN echo "extension=pdlib.so" > /usr/local/etc/php/conf.d/pdlib.ini NOTE: because Alpine contains a different version of wget (busybox instead of GNU), I had to apply a small patch to get the Makefile for facerecognition to work:
|
Great .. 😬
You enabled analysis for the user?
If this is, maybe we could add a better message saying it. 😞 Some notes about your dockerfile..
Add it due the test that depends on it, but Nextcloud already has it as a dependency. So, you don't need to add it there ..
This is completely unnecessary. I put it to check that there are no double libraries .. 😅
It is probably unnecessary, but it is more correct to expand the environment variables than replace them.. 😅 I'm not even sure it works well .. Would have to print the variable to know how to stay ... 😕 About the patch, then I think about it.. Thanks.. 😬 |
Good point, I did, but via the web interface.
Thanks for your feedback on the Dockerfile, I'll work on a proposal for a wiki page that includes the Dockerfile and post it later. |
Sorry for hijacking this issue again. Since this is clearly a different issue, I have opened a new one and will close this: #176 |
I recently installed the facerecognition app with the dependency binaries built from source. Upon running
occ face:background_job
, the app starts scanning, but until now all images are skipped because of the following error:Searching for this issue some indicate that it could be caused by a library version mismatch of libjpeg (source), but I'm struggling to see if that's the case. All my packages are up-to-date.
For reference,
apk list | grep libjpeg
outputs:The text was updated successfully, but these errors were encountered: