Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Width and Height of the image #64

Open
edu1525 opened this issue Jun 7, 2020 · 9 comments
Open

Width and Height of the image #64

edu1525 opened this issue Jun 7, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@edu1525
Copy link

edu1525 commented Jun 7, 2020

How to set the initial width and height of the image with this library? I'm trying to set lib-ngx-image-zoom style but it is not working.

@wittlock
Copy link
Owner

wittlock commented Jun 7, 2020

It's currently built so that the initial size, the thumbnail size, will be the size of the thumbnail. It was the requirement I had at the time I started. There's been several requests to alter this though so when I next have time to work on this library that is likely to be a first feature I'll try to tackle.

@wittlock wittlock added the enhancement New feature or request label Jun 7, 2020
@ronaksinghbagga
Copy link

Kindly bring this feature as soon as possible as handling image becomes difficult when having an image with large resolutions. waiting for this update in all version.

@mowamed
Copy link

mowamed commented Nov 1, 2020

@edu1525 & @ronaksinghbagga to change the width and height of the picture, add your styles to the file styles.scss in the root folder
example to modify the thumbnail
ngx-image-zoom .ngxImageZoomThumbnail { max-height: 200px; }

@savanrajkotiya
Copy link

@edu1525 & @ronaksinghbagga to change the width and height of the picture, add your styles to the file styles.scss in the root folder
example to modify the thumbnail
ngx-image-zoom .ngxImageZoomThumbnail { max-height: 200px; }

I have tried to set css like this one but it will not working perfectly in my case , i have full resolution of incoming image (5744 * 3741 ) and i would like to set & display in (1020 * 754).

@TLKG
Copy link

TLKG commented Apr 19, 2021

ngx-image-zoom .ngxImageZoomThumbnail { max-height: 200px; }

@edu1525 didn't help.

@imadharilla
Copy link

imadharilla commented Apr 27, 2021

ngx-image-zoom .ngxImageZoomThumbnail { max-height: 200px; }

@edu1525 didn't help.

You are trying to apply css properties from a parent component to a child component while their css logic is separated.
You can use ::ng-deep to make the child components inherit the css property

I think this will work for you :

::ng-deep ngx-image-zoom .ngxImageZoomThumbnail { max-height: 200px; }

@TLKG
Copy link

TLKG commented Apr 28, 2021

::ng-deep ngx-image-zoom .ngxImageZoomThumbnail { max-height: 200px; }

@imadharilla Although ng-deep is being deprecated, it works! Thanks.

@vsc-cnst
Copy link

vsc-cnst commented Mar 7, 2023

Friendly as if there is any news on this issue?

@JomaKar
Copy link

JomaKar commented Apr 28, 2024

the initial width and height would be awesome to be set on the attributes of the img tag, as they help reduce CLS https://web.dev/articles/cls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants