{"record":{"id":"5ccd76cd5c4b54a7","repo":"toeverything/AFFiNE","slug":"image-processing-failed-this-can-happen-if-finger","errorCode":null,"errorMessage":"Image processing failed. This can happen if fingerprint protection is enabled in your browser. Please check your browser settings and try again.","messagePattern":"Image processing failed\\. This can happen if fingerprint protection is enabled in your browser\\. Please check your browser settings and try again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/utils/reduce-image.ts","lineNumber":34,"sourceCode":"    img.onload = img.onerror = () => {\n      URL.revokeObjectURL(url);\n    };\n\n    const sizeInMB = file.size / (1024 * 1024);\n    if (sizeInMB > 10 || img.width > 4000 || img.height > 4000) {\n      // Compress the file to less than 10MB\n\n      try {\n        const compressedImg = await reduce().toBlob(file, {\n          max: 4000,\n          unsharpAmount: 80,\n          unsharpRadius: 0.6,\n          unsharpThreshold: 2,\n        });\n        return compressedImg;\n      } catch (error) {\n        if (error instanceof Error) {\n          throw new Error(\n            'Image processing failed. This can happen if fingerprint protection is enabled in your browser. Please check your browser settings and try again.'\n          );\n        } else {\n          throw new Error('Unknown error occurred');\n        }\n      }\n    }\n\n    return file;\n  };\n\n  const reducedBlob = await decodeAndReduceImage();\n\n  return new File([reducedBlob], file.name, {\n    type: file.type,\n    lastModified: file.lastModified,\n  });\n};","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/utils/reduce-image.ts#L16-L52","documentation":"decodeAndReduceImage wraps image-blob-reduce failures (images >10MB or >4000px) and rethrows with a user-facing explanation, commonly caused by canvas fingerprint protection in privacy browsers blocking pixel data access.","triggerScenarios":"Thrown in validateAndReduceImage when image-blob-reduce's toBlob compression fails for an image over 10MB or larger than 4000px, e.g. when canvas access is blocked by browser fingerprint protection.","commonSituations":"Compressing a large image fails, commonly because browser fingerprint/canvas protection blocks image processing. Disable fingerprint protection for the site or upload a smaller image.","solutions":["Disable browser fingerprint protection for this site and retry.","Try a different browser or grant canvas read permission."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}