Re: St.Icon aspect ratio



Hey Dr. Rolf,

Glad yo know you are working on this. You might have better luck asking in gnome-shell list for these questions.

For thumbnails, you can see how other JS apps in GNOME do it, in general you would use GnomeDesktopThumbnail API, as we do in Nautilus, and then the icons would be just images.

Cheers

On 23 April 2018 at 19:29, Dr. Rolf F. Buser-Kennedy <rolf fritz buser gmail com> wrote:
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
_______________________________________________
newcomers-list mailing list
newcomers-list gnome org
https://mail.gnome.org/mailman/listinfo/newcomers-list



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