It was a while, but I finally found the time to work with it again. The above issues still exist, but I think this is happening.
When I load the source images, then yes, the file is loaded and image objects are generated. But it seems that the attributes are not yet correct, and they will not be until the image is added to the DOM of the site and displayed. Div / image on hide () in IE does not have any size information; Safari has some information. For example, without adding the next div anywhere
var test = $("<div><img src='test.jpg'></div>")
the image contained in it has the following information:
width() = 0 ,attr("width") = 600 ,css("width") = "" andimg[0].clientWidth = 0 .
What's on Safari; on IE it is the same except attr("width") = 0 and css("width") = "auto" . Now I can not use this, and what broke my script and why I posted my original question. However, the moment I add this div and render it, all the correct values ββare displayed in the image object.
I am writing a small thinghie gallery that shows all the images that I have in this second .html file that I upload; this gallery, however, calculates and places thumbnails and prepares images that it displays in full resolution. To make it look normal, I basically wanted to create everything that is hidden, and then fade away. Alas, it seems that this whole idea will not be spread. A friend suggested loading everything in a tiny iframe to the left, where it is not visible, and working with it. Perhaps this is the way to go.
Another thing that I noticed, and which seems to be very closely related to the aforementioned download problem, is clone (). It seems that if the image is displayed,
var newimg = img.clone()
generates the same "empty" image object that I have to deal with above. Even when the original image is visible and contains all the necessary attributes, its clone does not.
Right now I see no other way but to rethink and rewrite parts of my gallery.
Jens
source share