0

I want to take size in bytes of image in page at the first load page, and then create a loading bar and show it loading similar preloader of flash. But I don't know if jQuery can take size in bytes of image or not.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Rueta
  • 3,317
  • 2
  • 23
  • 22
  • @Robert Good guess, I'd say, but who knows...? :) There's one more instance of "capacity" in the question BTW. – deceze Jun 23 '10 at 02:18
  • @deceze: (S)He wants a progress bar for the initially-loading image. – Robert Harvey Jun 23 '10 at 02:19
  • oh.. sorry.. i want to take size(mb) of image, not size(width-height) of image.. by Jquery Thankyou for edit my question ^^. i'm talking Eng very bad. – Rueta Jun 23 '10 at 02:26
  • 2
    possible duplicate of [How can you determine the file size in JavaScript?](http://stackoverflow.com/questions/1126905/how-can-you-determine-the-file-size-in-javascript) – deceze Jun 23 '10 at 02:37
  • THIS IS NOT A DUPLICATE OF [How can you determine the file size in JavaScript?](http://stackoverflow.com/questions/1126905/how-can-you-determine-the-file-size-in-javascript.) Read the two questions again. – Robert Harvey Jun 23 '10 at 15:22

1 Answers1

0

I think all of these answers require something server-side to determine the file-size (please correct me if I'm wrong), but it would probably be best to preload the size from server-size or do an AJAX request to determine the file-size, but the latter seems counter productive.

Kerry Jones
  • 21,806
  • 12
  • 62
  • 89
  • 1
    Wouldn't be hard to put it in a manifest-style entry that had the image sizes. Not quite sure how you'd do a preloader style thing though. Finding the status of the downloading image is the hard part. – Xorlev Jun 23 '10 at 03:12