danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.59k forks source link

Image resizing is not CSP compatible #1792

Open stgogm opened 7 years ago

stgogm commented 7 years ago

When resizing an image with a CSP active, the resized image results in stretched and/or malformed images. This is caused by the following line in resize.js:

imageElement.setAttribute('style', 'visibility:hidden;position:fixed;z-index:-100000');

This could be solved by allowing a CSP option, maybe ngf-csp="true", to add a class to the element instead of setting the style programmatically.

stgogm commented 7 years ago

I've created a pull request with a working solution in #1921.