Tuesday 27 October 2020

For image Aspect ratio calculation image is getting loaded 2 times

I'm trying to solve image is loading 2 times for a single preview

1st time image will be loaded for preview purpose in iframe

2nd time image metadata such as width, height will be fetched with same path

Below image shows 2 times loading same image:

enter image description here

in both the call 8.9kB,8.6kB will be loaded i want to avoid that.

Question: I want to calculate image aspect ratio with single load of image. 2 calls i need to avoid

Note: i want iframe based solution

Here is demo: https://codepen.io/eabangalore/pen/rNLWJWE?editors=1010

For reproducing: we need to disable cache

Please help me thanks in advance!!!



from For image Aspect ratio calculation image is getting loaded 2 times

No comments:

Post a Comment