V
venu madhav
Hi All,
In my application, I have an option where user can upload any
image and it would be displayed on top of a particular table. I've set
the width to be displayed as some width = 50px and height = 35px. If
the user uploads a file whose dimensions are more than that, then it
is shrinking the image size which is acceptable. But if the size of
the image is less than those dimensions then it is trying to enlarge
it which is looking pretty odd. Can some one let me know how can I
avoid this.
I tried calculating the size of the image before displaying.
But the problem is, since the image has to come from the server, it is
taking time to calculate its dimensions and in the meanwhile the next
steps are getting executed taking both the dimensions as zero. If I
put an alert in between, then am getting the dimensions correctly. Is
there any way to obtain the correct values without that alert message?
Please let me know if you need any further info,
Thank you,
Venu
In my application, I have an option where user can upload any
image and it would be displayed on top of a particular table. I've set
the width to be displayed as some width = 50px and height = 35px. If
the user uploads a file whose dimensions are more than that, then it
is shrinking the image size which is acceptable. But if the size of
the image is less than those dimensions then it is trying to enlarge
it which is looking pretty odd. Can some one let me know how can I
avoid this.
I tried calculating the size of the image before displaying.
But the problem is, since the image has to come from the server, it is
taking time to calculate its dimensions and in the meanwhile the next
steps are getting executed taking both the dimensions as zero. If I
put an alert in between, then am getting the dimensions correctly. Is
there any way to obtain the correct values without that alert message?
Please let me know if you need any further info,
Thank you,
Venu