It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

image file size in javascript

image file size in javascript

Postby pratamishus on Fri May 22, 2009 11:17 am

Hi! I have a web application that generates images (preloaders.net). When an image is generated I want it's size to be displayed. I can't use AJAX to make server show me the image size because it will double the server load). So what happens:

Code: Select all
function imageLoader(s, fun)
{
   genImage = new Image();
   genImage.onload=function (){setTimeout(fun, 0)};
   genImage.src=s;
}


each time the function is called, a request is sent to the server and when the genImage.onload runs it calls function that shows me the image. How can I get the file size of the image?

I have browsed dozens of sites and googled every byte of the internet :)... and could not find the solution.
pratamishus
 
Posts: 1
Joined: Fri May 22, 2009 10:57 am

Who is online

Users browsing this forum: No registered users and 6 guests