recognize icon indicating copy to clipboard operation
recognize copied to clipboard

Could not find MIME for Buffer <null>

Open mostofthetime opened this issue 4 years ago • 6 comments

Describe the bug When running the image classifier from cli (occ recognize:classify-images) i get many errors

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nginx/nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Tested with shipped Node.js (v14.18.2) and local Node.js (v16.13.2)

To Reproduce Steps to reproduce the behavior: run classifier for images

Expected behavior Classify pictures without contacts

Recognize:

  • JS-only mode: yes
  • Enabled modes: face recognition

Server:

  • Nextcloud: 22.2.3
  • OS: armbian
  • RAM: 2Gb with 4Gb swap
  • Processor Architecture ARM64

Additional context Latest version 1.9.0

mostofthetime avatar Jan 22 '22 12:01 mostofthetime

Mh. Is this the full stack trace? Do you get these intermittently between successful classifications or only in bulk at the start of the process?

marcelklehr avatar Jan 22 '22 13:01 marcelklehr

only at the start of the process. The full output is (Names replaced):

... Running array ( 0 => 'node', 1 => '/.../.../nextcloud/apps/recognize/src/classifier_faces.js', 2 => '-', ) Classifier process output: Platform node has already been set. Overwriting the platform with [object Object].

Classifier process output: { 'Contact': '/tmp/n_tmp_Q3LtT8', 'Contact': '/tmp/n_tmp_m2W4n9', 'Contact': '/tmp/n_tmp_YBPPAb', 'Contact': '/tmp/n_tmp_opiwAf', 'Contact': '/tmp/n_tmp_ispNYp', 'Contact': '/tmp/n_tmp_Xdk4cq', 'Contact': '/tmp/n_tmp_iDGMQw', 'Contact': '/tmp/n_tmp_xdaNfF', 'Contact': '/tmp/n_tmp_UtFenP', 'Contact': '/tmp/n_tmp_xGoGd1', 'Contact': '/tmp/n_tmp_OVI9sj', 'Contact': '/tmp/n_tmp_hpBeQD', 'Contact': '/tmp/n_tmp_MT9AVZ', 'Contact': '/tmp/n_tmp_1vKSNn', 'Contact': '/tmp/n_tmp_EMJ94R', 'Contact': '/tmp/n_tmp_Z5aO4n', 'Contact': '/tmp/n_tmp_O68NMV', 'Contact': '/tmp/n_tmp_D9BDdv' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Classifier process output: Error: Could not find MIME for Buffer at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15) at Jimp.parseBitmap (/.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:431:32) at /.../.../nextcloud/apps/recognize/node_modules/@jimp/core/dist/index.js:373:15 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { methodName: 'constructor' }

Result for Photo-44.JPG = [] Result for Photo-45.JPG = [] Result for Photo-46.JPG = [] Result for Photo-47.JPG = [] Result for Photo-48.JPG = []

... and so on...

mostofthetime avatar Jan 22 '22 17:01 mostofthetime

This seems similar to #137 then. Apparently there is a problem in reading the contact images. Maybe they changed the format between versions. I'll investigate.

marcelklehr avatar Jan 22 '22 17:01 marcelklehr

Thanks for investigate. I have verified the generated temp files. All files have 0 byte

mostofthetime avatar Jan 23 '22 09:01 mostofthetime

Which version of the contacts app is installed on your instance? How have the contact pictures been set on the contacts (via web UI / some other means)?

marcelklehr avatar Jan 24 '22 13:01 marcelklehr

The contacts app is on version 4.0.7. The contact pictures was set on web UI and iPhone. Yesterday i installed the Nextcloud 22.0.0 on a x64 intel Atom debian system with contacts app 4.07. I added a new contact with a pictures over web UI and js mode enable. Same issue.

mostofthetime avatar Jan 24 '22 17:01 mostofthetime

This issue is obsolete with recognize v3 which no longer uses contact pictures to categorize faces.

marcelklehr avatar Oct 06 '22 09:10 marcelklehr