Hi guys.
I am making an image gallery and I need to create thumbnails of each image.
However, each image may be a different size and I want my users to be able to select the thumbnail size based on a % of the original image.
The users will choose a % that the thumbnail will be.
The question is what is the math I need to use to scale various images by a given % the user selects?
For example one image may be 1920 wide x 1080 height.
How do I calculate this so the thumbnail is 10% of this?
It wouldn’t be as simple as multiplying each value by 10% would it?
192×108.
Isn’t that an image much smaller than 10% of the original?
Another image may be a 5k image:
5120×2880
How do I calculate a thumbnail for this of 5%, and 10%?
Thanks for your help.