mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-26 18:25:29 +01:00
Use naturalWidth, to show the actual image width (especially for upscaled images)
This commit is contained in:
parent
24cce08580
commit
7a1170f1dd
@ -269,7 +269,7 @@ function showImages(reqBody, res, outputContainer, livePreview) {
|
||||
<span class="imgSeedLabel"></span>
|
||||
</div>
|
||||
<button class="imgPreviewItemClearBtn image_clear_btn"><i class="fa-solid fa-xmark"></i></button>
|
||||
<span class="img_bottom_label">${imageWidth} x ${imageHeight}</span>
|
||||
<span class="img_bottom_label"></span>
|
||||
</div>
|
||||
`
|
||||
outputContainer.appendChild(imageItemElem)
|
||||
@ -298,6 +298,10 @@ function showImages(reqBody, res, outputContainer, livePreview) {
|
||||
imageElem.setAttribute('data-steps', imageInferenceSteps)
|
||||
imageElem.setAttribute('data-guidance', imageGuidanceScale)
|
||||
|
||||
imageElem.addEventListener('load', function() {
|
||||
imageItemElem.querySelector('.img_bottom_label').innerText = `${this.naturalWidth} x ${this.naturalHeight}`
|
||||
})
|
||||
|
||||
|
||||
const imageInfo = imageItemElem.querySelector('.imgItemInfo')
|
||||
imageInfo.style.visibility = (livePreview ? 'hidden' : 'visible')
|
||||
|
Loading…
Reference in New Issue
Block a user