This commit is contained in:
ChuXun
2026-01-04 17:58:44 +08:00
parent cf8f4c5c3a
commit ec3b5157fe
180 changed files with 4677 additions and 18032 deletions

View File

@@ -790,7 +790,7 @@
* @returns {HTMLImageElement} The new image.
*/
function getImageNaturalSizes(image, callback) {
function getImageNaturalSizes(image, callback,isLoadOriginal) {
var newImage = document.createElement('img'); // Modern browsers (except Safari)
var url = image.getAttribute('src') || ''
@@ -804,7 +804,7 @@
return newImage;
}
if (image.naturalWidth && !IS_SAFARI) {
if (!isLoadOriginal && image.naturalWidth && !IS_SAFARI) {
callback(image.naturalWidth, image.naturalHeight);
return newImage;
}
@@ -1034,7 +1034,7 @@
translateX: 0
}));
},
initImage: function initImage(done) {
initImage: function initImage(done,isLoadOriginal) {
var _this2 = this;
var options = this.options,
@@ -1096,7 +1096,7 @@
if (done) {
done();
}
});
},isLoadOriginal);
},
renderImage: function renderImage(done) {
var _this3 = this;
@@ -1814,9 +1814,11 @@
image.src = url
_this.imageData.width = originImage.naturalWidth
_this.imageData.height = originImage.naturalHeight
_this.imageData.naturalWidth = originImage.naturalWidth
_this.imageData.naturalHeight = originImage.naturalHeight
_this.initImage(()=>{
_this.renderImage()
})
},true)
})
}