St.Icon aspect ratio



Hi,

I am working on a fork of Carlos Soriano's Desktop Icon Extension. I would like to display the previews made 
by the tumbnailer as icons. I haven't found any attribute, which would allow me to get the icon through

 ... new St.Icon(...)

with unmodified aspect ratio. This is not really bad, because I can set the correct aspect ratio with

  ...set_style('height:' + ... + 'px;width:' + ... + 'px');

Height and width can easily be computed from the height and width of the thumbnail PNG file. To get those I 
have to read the first 24 bytes of the PNG file. This is where I got stuck. I only get a bunch of commas. It 
looks to me, that those commas act as placeholders, because I read it in a way which is not made for reading 
binary data. So my question is: how do I read bytes from a binary file in an extension?

The question would interest me, even if there is a direct way to get an icon with original aspect ratio.

Cheers,

Rolf


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]