@wordpress/upload-media
Version:
Core media upload logic.
24 lines (23 loc) • 590 B
JavaScript
class ImageFile extends File {
width = 0;
height = 0;
originalWidth = 0;
originalHeight = 0;
get wasResized() {
return (this.originalWidth || 0) > this.width || (this.originalHeight || 0) > this.height;
}
constructor(file, width, height, originalWidth, originalHeight) {
super([file], file.name, {
type: file.type,
lastModified: file.lastModified
});
this.width = width;
this.height = height;
this.originalWidth = originalWidth;
this.originalHeight = originalHeight;
}
}
export {
ImageFile
};
//# sourceMappingURL=image-file.js.map