Skip to content

Commit 1d7771d

Browse files
committed
fix: downloaded images are blurry compared to previewed images
1 parent 580b828 commit 1d7771d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,8 +1934,6 @@ function RemoteFunctions(config = {}) {
19341934
this.allImages = [];
19351935
this.imagesPerPage = 10;
19361936
this.scrollPosition = 0;
1937-
this.maxWidth = '800px'; // when current image dimension is not defined we use this as unsplash images are very large
1938-
this.maxHeight = '600px';
19391937

19401938
this.create();
19411939
}
@@ -2675,8 +2673,8 @@ function RemoteFunctions(config = {}) {
26752673

26762674
// show hovered image along with dimensions
26772675
thumbDiv.addEventListener('mouseenter', () => {
2678-
this.element.style.width = this._originalImageStyle.width || this.maxWidth;
2679-
this.element.style.height = this._originalImageStyle.height || this.maxHeight;
2676+
this.element.style.width = this._originalImageStyle.width;
2677+
this.element.style.height = this._originalImageStyle.height;
26802678

26812679
this.element.style.objectFit = this._originalImageStyle.objectFit || 'cover';
26822680
this.element.src = image.url || image.thumb_url;
@@ -2736,12 +2734,7 @@ function RemoteFunctions(config = {}) {
27362734
const filename = this._generateFilename(image);
27372735
const extnName = ".jpg";
27382736

2739-
const targetWidth = this._originalImageStyle.width || this.maxWidth;
2740-
const targetHeight = this._originalImageStyle.height || this.maxHeight;
2741-
const widthNum = parseInt(targetWidth);
2742-
const heightNum = parseInt(targetHeight);
2743-
2744-
const downloadUrl = image.url ? `${image.url}?w=${widthNum}&h=${heightNum}&fit=crop` : image.thumb_url;
2737+
const downloadUrl = image.url || image.thumb_url;
27452738
this._useImage(downloadUrl, filename, extnName, false, thumbDiv);
27462739
});
27472740

0 commit comments

Comments
 (0)