Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@fengyuanchen/loader
Advanced tools
JavaScript image loader (translates Exif Orientation by canvas).
npm install @fengyuanchen/loader
<script src="/path/to/loader.js"></script>
<img id="image" src="image.jpg">
var image = document.getElementById('image');
var loader = new Loader(image, {
done: function(image) {
console.log(image); // HTMLImageElement
}
});
You may set cropper options with new Loader(image, options)
.
String
'image'
'image'
and 'canvas'
Define the type of the loaded image or canvas.
new Loader(image, {
type: 'canvas',
done: function(canvas) {
console.log(canvas); // HTMLCanvasElement
console.log(canvas.toDataURL()); // Data URL
}
});
Number
NaN
Define the new width of the loaded image or canvas. Use the natural width of the original image by default.
Number
NaN
Define the new height of the loaded image or canvas. Use the natural height of the original image by default.
Number
0
Define the minimum width of the loaded image or canvas.
Number
0
Define the minimum height of the loaded image or canvas.
Number
Infinity
Define the maximum width of the loaded image or canvas.
Number
Infinity
Define the maximum height of the loaded image or canvas.
Function
null
Load complete callback.
new Loader(image, {
done: function(image) {
console.log(image);
}
});
If you have to use other global function with the same namespace, just call the Loader.noConflict
static method to revert to it.
<script src="other-loader.js"></script>
<script src="loader.js"></script>
<script>
Loader.noConflict();
// Code that uses other `Loader` can follow here.
</script>
FAQs
JavaScript image loader.
We found that @fengyuanchen/loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.