Base solution for your next web application
Open Closed

Cannot add profile picture - object doesn't support method toBlob #7295


User avatar
0
HelloService created

Cannot add profile picture. I get this browser-side error in console:

ERROR Error: Uncaught (in promise): TypeError: Object doesn't support property or method 'toBlob' TypeError: Object doesn't support property or method 'toBlob' at Anonymous function (http://localhost:4200/vendor.js:197116:13) at ZoneAwarePromise (http://localhost:4200/polyfills.js:13086:17) at ImageCropperComponent.prototype.getCanvasBlob (http://localhost:4200/vendor.js:197115:9) at ImageCropperComponent.prototype.cropToFile (http://localhost:4200/vendor.js:197097:9) at ImageCropperComponent.prototype.cropToOutputType (http://localhost:4200/vendor.js:197061:17) at ImageCropperComponent.prototype.crop (http://localhost:4200/vendor.js:197014:17) at ImageCropperComponent.prototype.doAutoCrop (http://localhost:4200/vendor.js:196974:13) at ImageCropperComponent.prototype.resetCropperPosition (http://localhost:4200/vendor.js:196692:9) at ImageCropperComponent.prototype.checkImageMaxSizeRecursively (http://localhost:4200/vendor.js:196572:13) at Anonymous function (http://localhost:4200/vendor.js:196555:38)
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

8 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, please share your ANZ version and framework.

    also is this profile picture functionality from ANZ by default or it's implemented by yourself?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    HelloService created

    Hi I am using the very latest version 7.0.0. I am trying to use the default function of adding a profile picture for the logged in user. I am using the .Net Core + Angular option

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @HelloService

    Have you installed your npm packages using yarn or npm ? If you have used npm, then could you try to remove node_modules folder and install the packages using yarn command ?

    Thanks,

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    HelloService created

    Hi. I previously used Yarn. I have also done what you suggested, removed the node_modules folder and ran Yarn again. I still get the same error. I see the error occurs as soon as I select the pic and it goes to the imageCropperComponent page. Then when I click the save button nothing happens also no additional erros.

    Please note that this is a stock standard download demo project from your site. I Remember also having the same issue with version 6.xxx and was hoping that 7.0 would solve it.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @HelloService

    Could you share which browser you are using ?

    I have tried on http://volosoft.demo.aspnetzero.com (username: admin, password: 123qwe) but couldn't reproduce the problem using Google Chrome.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    HelloService created

    Hi

    Thank you. I am having the problem with MS Edge. I tried now using Chrome and it worked! However it only displays half the picture, the style seems to cut it like a triangle. How can I fix the style to show the full face of user?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @HelloService

    Could you create an issue on https://github.com/aspnetzero/aspnet-zero-core/issues and include the picture you are trying if possible ?

    Thanks,

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    maliming created
    Support Team

    hi @HelloService already fixed. https://github.com/aspnetzero/aspnet-zero-core/pull/2540

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)