Discussion:
X-Face support for kdepim
(too old to reply)
Jakob Schroeter
2004-11-13 00:53:00 UTC
Permalink
Hi,

the author of the compface library agreed to change its license to LGPL. So it
should be possible to add my patches for kmail and knode to kdepim. This is
wished for in BR28319 and BR92261.
Please find the patch at http://camaya.net/download/kdepim-xface-v1.diff

The KXFace class is added to libkdepim. It is mostly based on libcompface.
In KMail, X-Faces can be set per identity, with preview. They are displayed in
the message reader alongside the headers for the fancy and standard header
styles. It is currently not yet possible to disable the X-Face display as
wished for on kmail-devel.
The KNode part adds support for displaying X-Faces only, you would have to
manually create an appropriate X-Face header.

I would like to commit by next friday if there are no serious objections by
then.
What do you think?

cheers,
Jakob
Allen Winter
2004-11-13 03:30:55 UTC
Permalink
Post by Jakob Schroeter
Hi,
the author of the compface library agreed to change its license to LGPL. So it
should be possible to add my patches for kmail and knode to kdepim. This is
wished for in BR28319 and BR92261.
Please find the patch at http://camaya.net/download/kdepim-xface-v1.diff
The KXFace class is added to libkdepim. It is mostly based on libcompface.
In KMail, X-Faces can be set per identity, with preview. They are displayed in
the message reader alongside the headers for the fancy and standard header
styles. It is currently not yet possible to disable the X-Face display as
wished for on kmail-devel.
The KNode part adds support for displaying X-Faces only, you would have to
manually create an appropriate X-Face header.
I would like to commit by next friday if there are no serious objections by
then.
What do you think?
I'd be very happy about it (not that I have any say on this issue).
I have been using your patch in Kmail for months and haven't encountered any problems.
It would be nice to finally have the patch out of my local files and into CVS.

My only wish is that the ancient X-Face stuff would be replaced by a modern "standard" with color support.

Regards,
Allen
--
Let's Keep the Political Talk Out of KDE PLEASE
Till Adam
2004-11-13 09:25:27 UTC
Permalink
Post by Allen Winter
Post by Jakob Schroeter
I would like to commit by next friday if there are no serious objections
by then.
What do you think?
I personally think that while your patch is well done and I hate to reject
work already done this feature is bloat, considering that it caters to a not
very modern feature which not many people are likely to use. (I might be
completely wrong in that judgment.) Were the decision mine I would not
include it in the standard distribution.
Post by Allen Winter
I'd be very happy about it (not that I have any say on this issue).
I have been using your patch in Kmail for months and haven't encountered
any problems. It would be nice to finally have the patch out of my local
files and into CVS.
My only wish is that the ancient X-Face stuff would be replaced by a modern
"standard" with color support.
With KMail from HEAD you can assign a picture to a person in KAddressBook and
it will be rendered into the headers area of each mail from them, provided
you use fancy headers which is the default.

I consider that the better and much more modern way to do this feature.

Till
Jakob Schroeter
2004-11-13 14:12:01 UTC
Permalink
Post by Till Adam
Post by Allen Winter
Post by Jakob Schroeter
I would like to commit by next friday if there are no serious
objections by then.
What do you think?
I personally think that while your patch is well done and I hate to reject
work already done this feature is bloat, considering that it caters to a
not very modern feature which not many people are likely to use. (I might
be completely wrong in that judgment.) Were the decision mine I would not
include it in the standard distribution.
It's a pity to hear that only now as the wish is around for ages and has more
than 340 votes (and I actually started posting patches months ago).
Every now and then there are mails which include a X-Face header. Granted,
it's seldom used, but since my first public patch for KMail numbers have
definitely increased. Can't speak for the non-technical masses, though.
Post by Till Adam
Post by Allen Winter
I'd be very happy about it (not that I have any say on this issue).
I have been using your patch in Kmail for months and haven't encountered
any problems. It would be nice to finally have the patch out of my local
files and into CVS.
My only wish is that the ancient X-Face stuff would be replaced by a
modern "standard" with color support.
With KMail from HEAD you can assign a picture to a person in KAddressBook
and it will be rendered into the headers area of each mail from them,
provided you use fancy headers which is the default.
I consider that the better and much more modern way to do this feature.
This works only for people you already know about and have added to your
address book. With X-Face it's the other way round. You can see a "picture"
of someone you never talked to before.
The sender decides what will be shown in the recipient's client.
Post by Till Adam
Till
cheers,
Jakob
Tom Albers
2004-11-13 16:50:23 UTC
Permalink
Post by Till Adam
Post by Jakob Schroeter
I would like to commit by next friday if there are no serious
objections by then.
What do you think?
I personally think that while your patch is well done and I hate to reject
work already done this feature is bloat, considering that it caters to a
not very modern feature which not many people are likely to use. (I might
be completely wrong in that judgment.) Were the decision mine I would not
include it in the standard distribution.
Till,

I do not like the way this is handled. You have asked me to test this feature.
I've done so, we solved some bugs in it and made some adjustments. Then there
was the issue of the license. Now that this is solved as well you call it
'bloat' and want to reject it. So is was just a waste of time. Not nice.

Tom
--
http://www.kde.nl | irc: {toma} | jabber: ***@jabber.kovoks.nl
Fingerprint: 0A86 039A 2393 9A86 51DC 2628 7204 244F D185 450F
Till Adam
2004-11-13 17:04:39 UTC
Permalink
Post by Tom Albers
Post by Till Adam
Post by Jakob Schroeter
I would like to commit by next friday if there are no serious
objections by then.
What do you think?
I personally think that while your patch is well done and I hate to
reject work already done this feature is bloat, considering that it
caters to a not very modern feature which not many people are likely to
use. (I might be completely wrong in that judgment.) Were the decision
mine I would not include it in the standard distribution.
I do not like the way this is handled. You have asked me to test this
feature. I've done so, we solved some bugs in it and made some adjustments.
Then there was the issue of the license. Now that this is solved as well
you call it 'bloat' and want to reject it. So is was just a waste of time.
Not nice.
I've said from the start that I consider it bloat and asked you whether you
want to test it to find out if it actually works and makes sense to you.
You've said it works and you like it. Great. I still don't think its usefull
for enough people to warrent inclusion, but the decision to reject it or not
is not mine to make. If Ingo and the team disagree with me, I'll happily
concede, but I wanted to state my opinion.

I should probably have stated that earlier and more clearly, but I think the
encouragement to work on that feature and improve it came from Ingo and
Allen, not me.

Till
Allen Winter
2004-11-13 22:22:06 UTC
Permalink
Post by Till Adam
Post by Allen Winter
Post by Jakob Schroeter
I would like to commit by next friday if there are no serious objections
by then.
What do you think?
I personally think that while your patch is well done and I hate to reject
work already done this feature is bloat, considering that it caters to a not
very modern feature which not many people are likely to use. (I might be
completely wrong in that judgment.) Were the decision mine I would not
include it in the standard distribution.
Post by Allen Winter
I'd be very happy about it (not that I have any say on this issue).
I have been using your patch in Kmail for months and haven't encountered
any problems. It would be nice to finally have the patch out of my local
files and into CVS.
My only wish is that the ancient X-Face stuff would be replaced by a modern
"standard" with color support.
With KMail from HEAD you can assign a picture to a person in KAddressBook and
it will be rendered into the headers area of each mail from them, provided
you use fancy headers which is the default.
Neat. See attached snapshot of the header when I send a message to myself.
How come my picture is a bit "pixelated"?? I have a bunch of digital pictures of family
and friends available so I just spent an hour or so adding pictures to my addressbook.

Nice that Kmail is smart and dumps my X-Face version picture in favor of the
Kaddressbook picture.
Post by Till Adam
I consider that the better and much more modern way to do this feature.
If I were working in an enterprise and we had a company-wide addressbook with everyone's picture
this would be a fantastic feature. I won't speak to the X-Faces bloat issue since 1) obviously I like
X-Faces even though I think it is ancient 2) I don't have a vote.

Regards,
Allen

PS. Now I need to get pictures of Ingo, Till, Cornelius, Reinhold, Tobias....
Ingo Klöcker
2004-11-14 02:32:20 UTC
Permalink
Post by Allen Winter
PS. Now I need to get pictures of Ingo, Till, Cornelius, Reinhold, Tobias....
http://pim.kde.org/development/meetings/20040102/group.php

Regards,
Ingo
Bo Thorsen
2004-11-16 09:23:49 UTC
Permalink
Post by Allen Winter
Post by Till Adam
Post by Allen Winter
Post by Jakob Schroeter
I would like to commit by next friday if there are no serious
objections by then.
What do you think?
I personally think that while your patch is well done and I hate to
reject work already done this feature is bloat, considering that it
caters to a not very modern feature which not many people are likely
to use. (I might be completely wrong in that judgment.) Were the
decision mine I would not include it in the standard distribution.
Post by Allen Winter
I'd be very happy about it (not that I have any say on this issue).
I have been using your patch in Kmail for months and haven't
encountered any problems. It would be nice to finally have the
patch out of my local files and into CVS.
My only wish is that the ancient X-Face stuff would be replaced by
a modern "standard" with color support.
With KMail from HEAD you can assign a picture to a person in
KAddressBook and it will be rendered into the headers area of each
mail from them, provided you use fancy headers which is the default.
Neat. See attached snapshot of the header when I send a message to
myself. How come my picture is a bit "pixelated"?? I have a bunch of
digital pictures of family and friends available so I just spent an
hour or so adding pictures to my addressbook.
Nice that Kmail is smart and dumps my X-Face version picture in favor
of the Kaddressbook picture.
Post by Till Adam
I consider that the better and much more modern way to do this feature.
If I were working in an enterprise and we had a company-wide
addressbook with everyone's picture this would be a fantastic feature.
I won't speak to the X-Faces bloat issue since 1) obviously I like
X-Faces even though I think it is ancient 2) I don't have a vote.
You can already do this with the existing implementation. Just put the URL
of the picture in the addressbook.

Bo.
Reinhold Kainhofer
2004-11-16 09:40:55 UTC
Permalink
Post by Bo Thorsen
Post by Allen Winter
If I were working in an enterprise and we had a company-wide
addressbook with everyone's picture this would be a fantastic feature.
I won't speak to the X-Faces bloat issue since 1) obviously I like
X-Faces even though I think it is ancient 2) I don't have a vote.
You can already do this with the existing implementation. Just put the URL
of the picture in the addressbook.
Nope, X-Faces is the other way round. You as sender put an image of yourself
into the header of the mail (it's b/w, so it takes only three lines or so),
so everybody who receives a mail from you can see your face, even if he has
never heard of you, and doesn't have an addressbook entry for yourself.
That's the big advantage over the addressbook-based image.

For the addressbook-based images, the receiver has to do the work, for the
X-Face image, the sender makes sure that the receiver sees the image.

For this reason, I really like the idea of X-Face (although I guess, most of
my receivers' mail clients don't know about X-Face).

Cheers,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, Vienna, Austria
email: ***@kainhofer.com, http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at
* K Desktop Environment, http://www.kde.org/, KOrganizer / KPilot maintainer
Bo Thorsen
2004-11-16 09:57:03 UTC
Permalink
Post by Reinhold Kainhofer
Post by Bo Thorsen
Post by Allen Winter
If I were working in an enterprise and we had a company-wide
addressbook with everyone's picture this would be a fantastic
feature. I won't speak to the X-Faces bloat issue since 1)
obviously I like X-Faces even though I think it is ancient 2) I
don't have a vote.
You can already do this with the existing implementation. Just put
the URL of the picture in the addressbook.
Nope, X-Faces is the other way round. You as sender put an image of
yourself into the header of the mail (it's b/w, so it takes only three
lines or so), so everybody who receives a mail from you can see your
face, even if he has never heard of you, and doesn't have an
addressbook entry for yourself. That's the big advantage over the
addressbook-based image.
For the addressbook-based images, the receiver has to do the work, for
the X-Face image, the sender makes sure that the receiver sees the
image.
For this reason, I really like the idea of X-Face (although I guess,
most of my receivers' mail clients don't know about X-Face).
But in this case, the discussion was about an addressbook that is shared
in the company - LDAP or IMAP-vCard/Kolab-XML shared folders. No need to
copy that information around in emails, when it's already available on
the server.

Bo.
Reinhold Kainhofer
2004-11-16 10:45:05 UTC
Permalink
Post by Bo Thorsen
Post by Reinhold Kainhofer
For the addressbook-based images, the receiver has to do the work, for
the X-Face image, the sender makes sure that the receiver sees the
image.
For this reason, I really like the idea of X-Face (although I guess,
most of my receivers' mail clients don't know about X-Face).
But in this case, the discussion was about an addressbook that is shared
in the company - LDAP or IMAP-vCard/Kolab-XML shared folders. No need to
copy that information around in emails, when it's already available on
the server.
Yes, but there was the "If I were working... and we had a company-wide
addressbook with everyone's pictures". And that's a really big IF. How many
companies have addressbooks with their employees pictures? (Are companies
even allowed by data privacy laws to make each employees picture to all other
employees without his explicit consent?) X-Face doesn't require anything like
that.

Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: ***@kainhofer.com, http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer / KPilot maintainer
Allen Winter
2004-11-16 12:55:10 UTC
Permalink
Post by Bo Thorsen
Post by Reinhold Kainhofer
Post by Bo Thorsen
Post by Allen Winter
If I were working in an enterprise and we had a company-wide
addressbook with everyone's picture this would be a fantastic
feature. I won't speak to the X-Faces bloat issue since 1)
obviously I like X-Faces even though I think it is ancient 2) I
don't have a vote.
You can already do this with the existing implementation. Just put
the URL of the picture in the addressbook.
Nope, X-Faces is the other way round. You as sender put an image of
yourself into the header of the mail (it's b/w, so it takes only three
lines or so), so everybody who receives a mail from you can see your
face, even if he has never heard of you, and doesn't have an
addressbook entry for yourself. That's the big advantage over the
addressbook-based image.
For the addressbook-based images, the receiver has to do the work, for
the X-Face image, the sender makes sure that the receiver sees the
image.
For this reason, I really like the idea of X-Face (although I guess,
most of my receivers' mail clients don't know about X-Face).
But in this case, the discussion was about an addressbook that is shared
in the company - LDAP or IMAP-vCard/Kolab-XML shared folders. No need to
copy that information around in emails, when it's already available on
the server.
Bo,

I think you missed my point: I was trying to say that the feature of reading the picture
from the addressbook was great... I'm using it right now.
But, for the reasons Reinhold pointed out I think we need something like X-Face too.

X-Face sucks because with only 48x48 black and white pixels it is very hard
to make a picture that looks like a human face. So people typically use little glyphs.
http://www.xs4all.nl/~ace/X-Faces/

http://quimby.gnus.org/circus/face has a proposal for a modern, color version of X-Face
if someone wants to work on that.. hint, hint.

Regards,
Allen
Jakob Schroeter
2004-11-16 13:20:51 UTC
Permalink
Post by Allen Winter
X-Face sucks because with only 48x48 black and white pixels it is very hard
to make a picture that looks like a human face. So people typically use
little glyphs. http://www.xs4all.nl/~ace/X-Faces/
http://quimby.gnus.org/circus/face has a proposal for a modern, color
version of X-Face if someone wants to work on that.. hint, hint.
I quickly abandoned this idea because personally I think *this* would be
overkill. ;) Additionally, I have no idea whether there are mail/news clients
supporting this except for gnus. But now that you mention it I would have a
look at it if there was some consensus that it would be nice to have this in
kmail.

BTW, I'm working on the changes Ingo proposed and will post the results asap.

cheers,
Jakob
Allen Winter
2004-11-16 13:36:55 UTC
Permalink
Post by Jakob Schroeter
Post by Allen Winter
X-Face sucks because with only 48x48 black and white pixels it is very hard
to make a picture that looks like a human face. So people typically use
little glyphs. http://www.xs4all.nl/~ace/X-Faces/
http://quimby.gnus.org/circus/face has a proposal for a modern, color
version of X-Face if someone wants to work on that.. hint, hint.
I quickly abandoned this idea because personally I think *this* would be
overkill. ;) Additionally, I have no idea whether there are mail/news clients
supporting this except for gnus. But now that you mention it I would have a
look at it if there was some consensus that it would be nice to have this in
kmail.
Agree. I would be wise to get kmail-devel approval before starting work on this.
What about color X-Face is overkill? The extra message size?

Regards,
Allen
Fred Emmott
2004-11-16 13:39:07 UTC
Permalink
Post by Allen Winter
Post by Jakob Schroeter
Post by Allen Winter
X-Face sucks because with only 48x48 black and white pixels it is very
hard to make a picture that looks like a human face. So people
typically use little glyphs. http://www.xs4all.nl/~ace/X-Faces/
http://quimby.gnus.org/circus/face has a proposal for a modern, color
version of X-Face if someone wants to work on that.. hint, hint.
I quickly abandoned this idea because personally I think *this* would be
overkill. ;) Additionally, I have no idea whether there are mail/news
clients supporting this except for gnus. But now that you mention it I
would have a look at it if there was some consensus that it would be nice
to have this in kmail.
Agree. I would be wise to get kmail-devel approval before starting work on
this. What about color X-Face is overkill? The extra message size?
Regards,
Allen
Is there a header along the lines of "X-Face-URL:
Loading Image..." ?
--
Fred Emmott
(http://www.fredemmott.co.uk)
Jan de Visser
2004-11-16 14:19:35 UTC
Permalink
Post by Fred Emmott
http://myserver.com/mypicture.png" ?
Erm. No. Rather not. Just as bad (or worse, cuz you don't really see it) as
loading external references in HTML mail. Spammer's wet dream.

JdV!!
--
--------------------------------------------------------------
Jan de Visser ***@digitalfairway.com

Baruk Khazad! Khazad ai-menu!
--------------------------------------------------------------
Ingo Klöcker
2004-11-16 21:40:28 UTC
Permalink
Post by Jan de Visser
Post by Fred Emmott
http://myserver.com/mypicture.png" ?
Erm. No. Rather not. Just as bad (or worse, cuz you don't really see
it) as loading external references in HTML mail. Spammer's wet dream.
Obviously those images would only be downloaded if the user asks for it.

Regards,
Ingo
Ingo Klöcker
2004-11-16 21:38:10 UTC
Permalink
Post by Allen Winter
Post by Jakob Schroeter
Post by Allen Winter
X-Face sucks because with only 48x48 black and white pixels it is
very hard to make a picture that looks like a human face. So
people typically use little glyphs.
http://www.xs4all.nl/~ace/X-Faces/
http://quimby.gnus.org/circus/face has a proposal for a modern,
color version of X-Face if someone wants to work on that.. hint,
hint.
I quickly abandoned this idea because personally I think *this*
would be overkill. ;) Additionally, I have no idea whether there
are mail/news clients supporting this except for gnus. But now that
you mention it I would have a look at it if there was some
consensus that it would be nice to have this in kmail.
Agree. I would be wise to get kmail-devel approval before starting
work on this. What about color X-Face is overkill? The extra message
size?
I'm more concerned about the restrictions of the Face specs. Why should
we replace b/w images by low quality (or low color) images? A
reasonable proposal would be a Photo-URL header which could
alternatively point to an attached image (via a cid: link as those used
for images embedded in HTML messages). It's really not necessary to
invent just another way to squeeze an image into a mail header.

BTW, it's not necessary to cc kmail-devel.

Regards,
Ingo
Ingo Klöcker
2004-11-16 21:37:55 UTC
Permalink
Post by Jakob Schroeter
Post by Allen Winter
X-Face sucks because with only 48x48 black and white pixels it is
very hard to make a picture that looks like a human face. So
people typically use little glyphs.
http://www.xs4all.nl/~ace/X-Faces/
http://quimby.gnus.org/circus/face has a proposal for a modern,
color version of X-Face if someone wants to work on that.. hint,
hint.
I quickly abandoned this idea because personally I think *this* would
be overkill. ;) Additionally, I have no idea whether there are
mail/news clients supporting this except for gnus. But now that you
mention it I would have a look at it if there was some consensus that
it would be nice to have this in kmail.
IMO it would be a much better idea to make KMail automatically display
the image of an attached vCard instead of adding support for some other
even less standard header than X-Face.

The only other addition that I could probably agree to would be support
for a header which holds the URL of a photo which we could then
download (and of course it should be cached locally just like the
favicons are cached).

Regards,
Ingo
Ingo Klöcker
2004-11-14 22:22:21 UTC
Permalink
Post by Jakob Schroeter
Hi,
the author of the compface library agreed to change its license to
LGPL. So it should be possible to add my patches for kmail and knode
to kdepim. This is wished for in BR28319 and BR92261.
Please find the patch at
http://camaya.net/download/kdepim-xface-v1.diff
The KXFace class is added to libkdepim. It is mostly based on
libcompface. In KMail, X-Faces can be set per identity, with preview.
They are displayed in the message reader alongside the headers for
the fancy and standard header styles. It is currently not yet
possible to disable the X-Face display as wished for on kmail-devel.
The KNode part adds support for displaying X-Faces only, you would
have to manually create an appropriate X-Face header.
I would like to commit by next friday if there are no serious
objections by then.
What do you think?
I general the patch is okay and it works quite nicely. But it's not
ready for committing. Let's go into the details:

In kmail/headerstyle.cpp:
- The X-Face image should only be shown with the fancy header style. In
particular this means that moving FancyHeaderStyle::imgToDataUrl to
HeaderStyle::imgToDataUrl is not necessary.

- The X-Face image should only be shown if there's no image for the
sender in the address book, i.e. if photoURL.isEmpty(). See
headerstyle.cpp around line 460.


In kmail/identitydialog.cpp:
- I think "X-Face" is a bad description for the tab. I suggest using
"Photo" instead. On the tab there should then be some text which
explains that currently only black-white photos are supported.


In kmail/xfaceconfigurator.cpp:
- The license of this file should be GPL + Qt exception as for example
in folderstorage.cpp.

- It's not acceptable (usability-wise) that the user has to create the
X-Face header himself. The user should just have to select an image
file. Then an X-Face should be created from this image (i.e. scale it
to 48x48 and then make it black-white). Internally the X-Face should be
stored.

- The links are not necessary when the user can simply select an image
file.


In libkdepim/Makefile.am:
- It doesn't seem to be necessary to link against libkmime and to add
-I$(top_srcdir)/libkmime.


In libkdepim/kxface.*:
- Please give comp and uncomp more meaningful names. From the name it's
completely unclear to me what those methods do.

- I don't like all the #defines in kxface.h. This will probably lead to
conflicts. Therefore please move all defines which are not needed in
kxface.h to kxface.cpp and replace the remaining defines by private
static const members of KXFace or by a private typedefs (in case of
WORD).

- Pass QString as 'const QString &' in comp, uncomp and toPixmap.

- KXFace::toPixmap doesn't look very efficient. tmp should be char
instead of QString. And the long if-else statement should be a switch
statement.

- KXFace::comp doesn't guard against a possible buffer overflow.
+ char *fbuf = (char *)malloc(MAX_XFACE_LENGTH);
+ memset(fbuf, '\0', MAX_XFACE_LENGTH);
+ strncpy(fbuf, str.latin1(), str.length());
You have to add a str.truncate( MAX_XFACE_LENGTH ) in the first line.
Interestingly KXFace::uncomp checks the length of the parameter.

- KXFace::x and KXFace::y should be static methods and the parameter
should be passed as 'const int pos'.

=====

Now a few things which could be done to improve the feature:
- In the configuration: Add the possibility to load the X-Face from the
image in the user's own address book entry.

- Add the possibility to store the X-Face in the address book entry of
the sender (via an action in the context menu).

Regards,
Ingo
Jakob Schroeter
2004-11-17 04:30:32 UTC
Permalink
Hi,

I added/changed all the things Ingo suggested, except for this one
Post by Ingo Klöcker
- Add the possibility to store the X-Face in the address book entry of
the sender (via an action in the context menu).
which might come later.

In the configurator, one can choose between either creating the X-Face from an
image file, the image stored in the addressbook or entering the string
directly.
I renamed the public functions in KXFace to toBitmap() and fromImage().

The new version is at http://camaya.net/download/kdepim-xface-v1.2.diff

BTW, which is the correct way to make a QLabel wrap it's content apart from
interspersing '\n's? (see xfaceconfigurator.cpp, line 385)

cheers,
Jakob
Martin Koller
2004-11-17 08:41:20 UTC
Permalink
Post by Jakob Schroeter
BTW, which is the correct way to make a QLabel wrap it's content apart from
interspersing '\n's? (see xfaceconfigurator.cpp, line 385)
I use the Richt-Text capabilities for such things, e.g.
<qt>sometext<br>newline text</qt>
--
Best regards/Schöne Grüße

Martin
registered as user #332716 with the Linux Counter, http://counter.li.org

Some operating systems are called 'user friendly',
Linux however is 'expert friendly'.
Reinhold Kainhofer
2004-11-17 08:55:35 UTC
Permalink
Post by Jakob Schroeter
BTW, which is the correct way to make a QLabel wrap it's content apart from
interspersing '\n's? (see xfaceconfigurator.cpp, line 385)
You want to leave it to Qt, where the line break appears? That's done by
setAlignment (http://doc.trolltech.com/3.3/qlabel.html#setAlignment), e.g.:
textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );


Cheers,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, Vienna, Austria
email: ***@kainhofer.com, http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at
* K Desktop Environment, http://www.kde.org/, KOrganizer / KPilot maintainer
Jakob Schroeter
2004-11-17 10:41:24 UTC
Permalink
Post by Reinhold Kainhofer
Post by Jakob Schroeter
BTW, which is the correct way to make a QLabel wrap it's content apart
from interspersing '\n's? (see xfaceconfigurator.cpp, line 385)
You want to leave it to Qt, where the line break appears? That's done by
textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
Thanks, looks fine now.
New version at http://camaya.net/download/kdepim-xface-v1.3.diff


cheers,
Jakob
Jakob Schroeter
2004-11-18 00:16:48 UTC
Permalink
Hi,

just a small update that makes sure the xface string is stored and put into a
mail in a well-defined way.
When storing it in the identity whitespace and newlines are stripped. When
putting it into a message header it is split into multiple lines.

get it at: http://camaya.net/download/kdepim-xface-v1.4.diff

cheers,
Jakob
Ingo Klöcker
2004-11-21 19:07:15 UTC
Permalink
Post by Jakob Schroeter
Hi,
just a small update that makes sure the xface string is stored and
put into a mail in a well-defined way.
When storing it in the identity whitespace and newlines are stripped.
When putting it into a message header it is split into multiple
lines.
get it at: http://camaya.net/download/kdepim-xface-v1.4.diff
The patch is almost ready for being committed. A few minor issues:

- In
+ userHTML = QString( "<div class=\"senderpic\">"
+ "<a href=\"im:%1\">%2<div class=\"senderstatus\">"
+ "<span name=\"presence-%3\">%4</span></div></a>"
+ "</div>" ).arg( kabcUid )
+ .arg( presence )
+ .arg( kabcUid )
+ .arg( userHTML );
you swapped .arg( presence ) and .arg( userHTML ). That's not correct.
The presence should be shown below the image.

- The following code
+ QString xface = ident.xface();
+ int numNL = xface.length() / 70;
+ for (int i=1; i<=numNL; ++i)
+ xface.insert(i*70, "\n ");
has a few problems:
* It won't do exactly what you want (i.e. insert a \n each 70th char)
because it doesn't take the already inserted '\n' into account. The
following loop does:
for ( int i = numNL; i > 0; --i )
xface.insert( i*70, "\n\t" );
It also inserts a tab instead of several spaces.
* If the length is exactly divisible by 70 then there must not be a '\n'
inserted at the end. Fixed by
int numNL = ( xface.length() - 1 ) / 70;
* Last but not least, an empty X-Face header should not be added. Thus
you should add a check for xface.isEmpty() (which is anyway necessary
because of the above xface.length() - 1 ).

- Breaking the header into shorter lines is missing in the second spot
where the X-Face header is set.

- i18n("&Send picture with every Email") should be i18n("&Send picture
with every message").

- i18n( "Check this box if you want KMail to add a so-called X-Face
header to mails "
"mails" is a Genglish (German-English) word for "messages". Therefore
it must be
i18n( "Check this box if you want KMail to add a so-called X-Face header
to messages "

- KMessageBox::information( this, "No picture set for your Adressbook
entry.", "No picture" );
should be
KMessageBox::information( this, "No picture set for your address book
entry.", "No picture" );

- If you want to return an empty QString then better use
return QString::null
instead of
return QString(),
e.g. in KXFace::fromImage()

- Please use QCString instead of char *, malloc, strcpy, free in
KXFace::fromImage(), if only to make me sleep better.

Regards,
Ingo
Jakob Schroeter
2004-11-21 20:17:35 UTC
Permalink
Post by Ingo Klöcker
Post by Jakob Schroeter
Hi,
just a small update that makes sure the xface string is stored and
put into a mail in a well-defined way.
When storing it in the identity whitespace and newlines are stripped.
When putting it into a message header it is split into multiple
lines.
get it at: http://camaya.net/download/kdepim-xface-v1.4.diff
- In
+ userHTML = QString( "<div class=\"senderpic\">"
+ "<a href=\"im:%1\">%2<div class=\"senderstatus\">"
+ "<span name=\"presence-%3\">%4</span></div></a>"
+ "</div>" ).arg( kabcUid )
+ .arg( presence )
+ .arg( kabcUid )
+ .arg( userHTML );
you swapped .arg( presence ) and .arg( userHTML ). That's not correct.
The presence should be shown below the image.
I changed this back and forth several times because I didn't like the way it
was displayed (stretches the header when there is a picture to display and
the status says "status not available"). Must have slipped through somehow
when "undoing". How about showing the status alongside the picture?
Post by Ingo Klöcker
- The following code
+ QString xface = ident.xface();
+ int numNL = xface.length() / 70;
+ for (int i=1; i<=numNL; ++i)
+ xface.insert(i*70, "\n ");
* It won't do exactly what you want (i.e. insert a \n each 70th char)
because it doesn't take the already inserted '\n' into account.
Yes, I am aware of this. I didn't bother have it wrap at column 70 exactly
because I thought it wasn't necessary. It rarely happens that an xface string
is longer than 700 char, if at all. Anyway, I'll change it.

I'll also fix the remaining issues and commit.

cheers,
Jakob
Sylvain 'Skarsnik' Colinet
2004-11-22 00:16:05 UTC
Permalink
Post by Jakob Schroeter
Post by Ingo Klöcker
Post by Jakob Schroeter
Hi,
just a small update that makes sure the xface string is stored and
put into a mail in a well-defined way.
When storing it in the identity whitespace and newlines are stripped.
When putting it into a message header it is split into multiple
lines.
get it at: http://camaya.net/download/kdepim-xface-v1.4.diff
- In
+ userHTML = QString( "<div class=\"senderpic\">"
+ "<a href=\"im:%1\">%2<div class=\"senderstatus\">"
+ "<span name=\"presence-%3\">%4</span></div></a>"
+ "</div>" ).arg( kabcUid )
+ .arg( presence )
+ .arg( kabcUid )
+ .arg( userHTML );
you swapped .arg( presence ) and .arg( userHTML ). That's not correct.
The presence should be shown below the image.
I changed this back and forth several times because I didn't like the way
it was displayed (stretches the header when there is a picture to display
and the status says "status not available"). Must have slipped through
somehow when "undoing". How about showing the status alongside the picture?
Post by Ingo Klöcker
- The following code
+ QString xface = ident.xface();
+ int numNL = xface.length() / 70;
+ for (int i=1; i<=numNL; ++i)
+ xface.insert(i*70, "\n ");
* It won't do exactly what you want (i.e. insert a \n each 70th char)
because it doesn't take the already inserted '\n' into account.
Yes, I am aware of this. I didn't bother have it wrap at column 70 exactly
because I thought it wasn't necessary. It rarely happens that an xface
string is longer than 700 char, if at all. Anyway, I'll change it.
I'll also fix the remaining issues and commit.
cheers,
Jakob
I have a stupib question, does it work in knode ?
--
Sylvain "Skarsnik" Colinet, Secrétaire d'EpX.

Victory was near but the power of the ring couldn't be undone
Tom Albers
2004-11-23 18:51:14 UTC
Permalink
Post by Sylvain 'Skarsnik' Colinet
I have a stupib question, does it work in knode ?
It has been added to KNode:
http://bugs.kde.org/show_bug.cgi?id=92261

Tom
--
http://www.kde.nl | irc: {toma} | jabber: ***@jabber.kovoks.nl
Fingerprint: 0A86 039A 2393 9A86 51DC 2628 7204 244F D185 450F
Martin Koller
2004-11-26 21:58:26 UTC
Permalink
Post by Jakob Schroeter
I'll also fix the remaining issues and commit.
As you can see, I'm using this new feature, and I like it.
It's kind of a "business-card".

Beside this, I have seen that the configuration dialog in kmail to use a
picture has the following issues:

- The "Obtain picture from" Combobox is behaving very annoyingly and
"non-standard". Every time I highlight an item in the list, my user interface
below it changes suddenly.

I recommend to change the combobox to a radio button with the 2 items in it,
and modify the widgets when the user really has selected a mode.
(A Combobox with only 2 entries is generally not a good choice)

As there are only a few widgets which you change according to the mode, I
would let them all always be visible but disable those which are not used for
the selected mode. I think this gives the best user experience.

- The import itself seems to be broken. I attach the picture I used. Loading
it only creates a garbled picture.
(I used the same picture with the online X-Face converter at
http://www.dairiki.org/xface/xface.php where it gives a good result)
--
Best regards/Schöne Grüße

Martin () ascii ribbon campaign - against html mail
/\ - against microsoft attachments

Some operating systems are called 'user friendly',
Linux however is 'expert friendly'.
Adriaan de Groot
2004-11-26 22:03:29 UTC
Permalink
Post by Martin Koller
Post by Jakob Schroeter
I'll also fix the remaining issues and commit.
As you can see, I'm using this new feature, and I like it.
It's kind of a "business-card".
It appears to be very slow - I get the impression that X-Face messages take
far longer (half a second?) to render than non-X-Face ones. There's also a
bit of a rendering bug, as I can scroll the message you sent down a bit, then
up again to get your hair to turn blue. It suits you, though :)
--
Don't worry, 't ain't no shame to be stupid - ol' mouse.
GPG: FEA2 A3FE Adriaan de Groot
Allen Winter
2004-11-26 22:16:14 UTC
Permalink
Post by Adriaan de Groot
Post by Martin Koller
Post by Jakob Schroeter
I'll also fix the remaining issues and commit.
As you can see, I'm using this new feature, and I like it.
It's kind of a "business-card".
It appears to be very slow - I get the impression that X-Face messages take
far longer (half a second?) to render than non-X-Face ones. There's also a
bit of a rendering bug, as I can scroll the message you sent down a bit, then
up again to get your hair to turn blue. It suits you, though :)
The rendering bug happens for Jakob's X-Face too, so it isn't a problem
specific to Martin's X-Face. The top 1/4 (approx) of the X-Face turns blue
whenever you scroll the X-Face away and then back again. I have been
using Jakob's X-Face patch for many months and have never seen this
behavior before.

Regards,
Allen
--
Let's Keep the Political Talk Out of KDE PLEASE
Jakob Schroeter
2004-11-26 22:43:17 UTC
Permalink
Post by Allen Winter
Post by Adriaan de Groot
Post by Martin Koller
Post by Jakob Schroeter
I'll also fix the remaining issues and commit.
As you can see, I'm using this new feature, and I like it.
It's kind of a "business-card".
It appears to be very slow - I get the impression that X-Face messages
take far longer (half a second?) to render than non-X-Face ones. There's
also a bit of a rendering bug, as I can scroll the message you sent down
a bit, then up again to get your hair to turn blue. It suits you, though
:)
The rendering bug happens for Jakob's X-Face too, so it isn't a problem
specific to Martin's X-Face. The top 1/4 (approx) of the X-Face turns
blue whenever you scroll the X-Face away and then back again. I have been
using Jakob's X-Face patch for many months and have never seen this
behavior before.
I didn't notice this either, only after I committed. -(
However, I don't think it's got to do with the X-Face per se. Someone posted a
message (here or on kmail-devel, can't find it atm) months ago having the
same issue with attached (inline) 1-bit images (X-Faces, IIRC ;).
BTW, KNode does not show this behaviour (does not use khtml but ktextbrowser).

cheers,
Jakob
Martin Koller
2004-11-26 22:45:06 UTC
Permalink
Post by Allen Winter
The rendering bug happens for Jakob's X-Face too, so it isn't a problem
specific to Martin's X-Face.   The top 1/4 (approx) of the X-Face turns
blue whenever you scroll the X-Face away and then back again.  I have been
using Jakob's X-Face patch for many months and have never seen this
behavior before.
I see this here, too. Must be a general khtml bug - try to mark parts of the
header with the mouse. Sometimes the x-face picture gets blank ...
--
Best regards/Schöne Grüße

Martin () ascii ribbon campaign - against html mail
/\ - against microsoft attachments

Some operating systems are called 'user friendly',
Linux however is 'expert friendly'.
Ingo Klöcker
2004-11-27 23:34:46 UTC
Permalink
Post by Adriaan de Groot
Post by Martin Koller
Post by Jakob Schroeter
I'll also fix the remaining issues and commit.
As you can see, I'm using this new feature, and I like it.
It's kind of a "business-card".
It appears to be very slow - I get the impression that X-Face
messages take far longer (half a second?) to render than non-X-Face
ones.
Indeed. It's extremely slow. Can you please look into this Jakob?

Regards,
Ingo
Jakob Schroeter
2004-11-28 00:50:06 UTC
Permalink
Post by Ingo Klöcker
Indeed. It's extremely slow. Can you please look into this Jakob?
I never noticed a speed difference, probably because the machine is already
slow enough.

However, I wrote a small test program[1] and time'ing it gives an average of:
real 0m0.806s
user 0m0.526s
sys 0m0.062s

while the original uncompface[2] gives a max of:
real 0m0.041s
user 0m0.007s
sys 0m0.003s

but more often:
real 0m0.007s
user 0m0.004s
sys 0m0.004s

This is probably not the best approach. Any hints how to proceed from here?
Valgrind? Does it compile on Linux 2.6 nowadays?


cheers,
Jakob

[1] http://camaya.net/download/speedtest.cpp
[2] http://freshmeat.net/projects/compface/
Jakob Schroeter
2004-11-28 00:55:43 UTC
Permalink
Post by Jakob Schroeter
Post by Ingo Klöcker
Indeed. It's extremely slow. Can you please look into this Jakob?
I never noticed a speed difference, probably because the machine is already
slow enough.
However, I wrote a small test program[1] and time'ing it gives an average
of: real 0m0.806s
user 0m0.526s
sys 0m0.062s
Forgot this part:
It's more like the following when I create an empty Bitmap in line 17.
real 0m0.614s
user 0m0.423s
sys 0m0.059s
Post by Jakob Schroeter
real 0m0.041s
user 0m0.007s
sys 0m0.003s
real 0m0.007s
user 0m0.004s
sys 0m0.004s
This is probably not the best approach. Any hints how to proceed from here?
Valgrind? Does it compile on Linux 2.6 nowadays?
cheers,
Jakob
[1] http://camaya.net/download/speedtest.cpp
[2] http://freshmeat.net/projects/compface/
Ingo Klöcker
2004-11-30 23:14:01 UTC
Permalink
Post by Jakob Schroeter
Post by Ingo Klöcker
Indeed. It's extremely slow. Can you please look into this Jakob?
Hmm, it's not that slow. The slowness I noticed is caused by the
verification of the PGP signatures. Doh.
Post by Jakob Schroeter
I never noticed a speed difference, probably because the machine is
already slow enough.
However, I wrote a small test program[1] and time'ing it gives an
average of: real 0m0.806s
user 0m0.526s
sys 0m0.062s
real 0m0.041s
user 0m0.007s
sys 0m0.003s
real 0m0.007s
user 0m0.004s
sys 0m0.004s
I've improved the test program (attached) a bit. It shows that it's
x.toBitmap(s);
which is slow (about 80-90 msec here). You have to run the program
several times to get more or less accurate timings. An easy method to
profile the x-face code would be a similar approach.

Regards,
Ingo
Jakob Schroeter
2004-12-01 00:10:37 UTC
Permalink
Post by Ingo Klöcker
I've improved the test program (attached) a bit. It shows that it's
x.toBitmap(s);
which is slow (about 80-90 msec here). You have to run the program
several times to get more or less accurate timings. An easy method to
profile the x-face code would be a similar approach.
Thanks. Been there, done that.
It shows that QBitmap::loadFromData() (kxface.cpp, line 172) with type XBM is
to blame here. Here it takes about 120ms while the xface specific code up to
this point takes only ~10ms. Maybe there is another input type that is faster
to read but not slower to create from the xface. Will check.

cheers,
Jakob
Ingo Klöcker
2004-12-01 23:29:48 UTC
Permalink
Post by Jakob Schroeter
Post by Ingo Klöcker
I've improved the test program (attached) a bit. It shows that it's
x.toBitmap(s);
which is slow (about 80-90 msec here). You have to run the program
several times to get more or less accurate timings. An easy method
to profile the x-face code would be a similar approach.
Thanks. Been there, done that.
It shows that QBitmap::loadFromData() (kxface.cpp, line 172) with
type XBM is to blame here. Here it takes about 120ms while the xface
specific code up to this point takes only ~10ms. Maybe there is
another input type that is faster to read but not slower to create
from the xface. Will check.
According to the documentation of QImage the QPixmap::convertToImage()
used in
photoURL = imgToDataUrl( xf.toBitmap( xfhead ).convertToImage() );
is a slow function (so this might add to the slowness). And since we
anyway need a QImage you could directly create a QImage. To make things
easier (and probably also faster) you should create an 8-bit image
instead of a 1-bit image. The additional memory consumption is
neglectable for those small images.

Regards,
Ingo

Nathan Toone
2004-12-01 00:09:58 UTC
Permalink
Post by Ingo Klöcker
I've improved the test program (attached) a bit. It shows that it's
x.toBitmap(s);
which is slow (about 80-90 msec here). You have to run the program
several times to get more or less accurate timings. An easy method to
profile the x-face code would be a similar approach.
Some of the slowness might be caused by the CPU issue with <img
src="data:..."> urls...

I have reported this to kde-devel.

-Nathan
Jakob Schroeter
2004-11-26 22:26:53 UTC
Permalink
Post by Martin Koller
Post by Jakob Schroeter
I'll also fix the remaining issues and commit.
As you can see, I'm using this new feature, and I like it.
It's kind of a "business-card".
Beside this, I have seen that the configuration dialog in kmail to use a
- The "Obtain picture from" Combobox is behaving very annoyingly and
"non-standard". Every time I highlight an item in the list, my user
interface below it changes suddenly.
Thanks for your input, I'll experiment with it.
Post by Martin Koller
- The import itself seems to be broken. I attach the picture I used.
Loading it only creates a garbled picture.
(I used the same picture with the online X-Face converter at
http://www.dairiki.org/xface/xface.php where it gives a good result)
There was a typo in the import that was fixed with my last commit (wednesday).
The online converter preserves the dimensions, though.

cheers,
Jakob
Jakob Schroeter
2004-11-28 02:27:53 UTC
Permalink
Post by Jakob Schroeter
Post by Martin Koller
Post by Jakob Schroeter
I'll also fix the remaining issues and commit.
As you can see, I'm using this new feature, and I like it.
It's kind of a "business-card".
Beside this, I have seen that the configuration dialog in kmail to use a
- The "Obtain picture from" Combobox is behaving very annoyingly and
"non-standard". Every time I highlight an item in the list, my user
interface below it changes suddenly.
Thanks for your input, I'll experiment with it.
IMHO, the best solution would be to only switch the widgets when an entry is
eventually activated. The same goes for the combobox in the signature
configurator. I'll change both of them tomorrow if nobody objects.

cheers,
Jakob
Ingo Klöcker
2004-11-28 15:03:27 UTC
Permalink
Post by Jakob Schroeter
Post by Jakob Schroeter
Post by Martin Koller
- The "Obtain picture from" Combobox is behaving very annoyingly
and "non-standard". Every time I highlight an item in the list,
my user interface below it changes suddenly.
Thanks for your input, I'll experiment with it.
IMHO, the best solution would be to only switch the widgets when an
entry is eventually activated. The same goes for the combobox in the
signature configurator. I'll change both of them tomorrow if nobody
objects.
This has been discussed before. Please check the archive for reasons for
the current behavior.

Regards,
Ingo
Sylvain 'Skarsnik' Colinet
2004-11-15 17:34:10 UTC
Permalink
Post by Jakob Schroeter
Hi,
the author of the compface library agreed to change its license to LGPL. So
it should be possible to add my patches for kmail and knode to kdepim. This
is wished for in BR28319 and BR92261.
Please find the patch at http://camaya.net/download/kdepim-xface-v1.diff
The KXFace class is added to libkdepim. It is mostly based on libcompface.
In KMail, X-Faces can be set per identity, with preview. They are displayed
in the message reader alongside the headers for the fancy and standard
header styles. It is currently not yet possible to disable the X-Face
display as wished for on kmail-devel.
The KNode part adds support for displaying X-Faces only, you would have to
manually create an appropriate X-Face header.
I would like to commit by next friday if there are no serious objections by
then.
What do you think?
cheers,
Jakob
Good news, I need xface in knode
--
Sylvain "Skarsnik" Colinet, Secrétaire d'EpX.

Victory was near but the power of the ring couldn't be undone
Continue reading on narkive:
Loading...