Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getting image physical size

1 view
Skip to first unread message

Anatoly Kaverin

unread,
Aug 17, 2005, 4:45:53 AM8/17/05
to
Hi, to everyone

We need to get an image physical size (not dimentions) from Web page loaded
into Firefox browser.

Is it possible to get it via XPCOM without additional reloading???

Can it be accessible from FF Extension(JavaScript) or plug-in(C++) ???

Thanx for Your attention.

With Best Regards,
Anatoly Kaverin,
http://www.vengine.com
C O M O D O group
a.ka...@gmail.com
MSN: tol...@hotmail.com


Daniel Kirsch

unread,
Aug 17, 2005, 7:50:15 AM8/17/05
to
Anatoly Kaverin wrote:
> We need to get an image physical size (not dimentions) from Web page
> loaded into Firefox browser.
>
> Is it possible to get it via XPCOM without additional reloading???

From
chrome\browser\content\browser\metaData.js

function getSize(url) {
try
{
var cacheEntryDescriptor = httpCacheSession.openCacheEntry(url,
Components.interfaces.nsICache.ACCESS_READ, false);
if(cacheEntryDescriptor)
return cacheEntryDescriptor.dataSize;
}
catch(ex) {}
try
{
cacheEntryDescriptor = ftpCacheSession.openCacheEntry(url,
Components.interfaces.nsICache.ACCESS_READ, false);
if (cacheEntryDescriptor)
return cacheEntryDescriptor.dataSize;
}
catch(ex) {}
return -1;
}

Daniel

F'up set to netscape.public.mozilla.xpcom

0 new messages