[Kde-pim] Review Request: Don't always recompress contact photos when saving
Sebastian
asamk at gmx.de
Sat Oct 6 19:45:09 BST 2012
Hi,
> I am a bit concerned about the asymmetry of the two getter/setters invovled.
> Calling setRawData() will make rawData() and data() return the expected
> results, calling setData() will only make data() return the expected result,
> while rawData() will return "there is no image data in this picture object".
>
> One idea would be to make the setters always clear the other field and the
> getters update their field if only the other one is present.
done, I made a new patch to remove the asymmetry of the getter/setters.
> Or maybe we could just always encode as PNG, thus solving the bug by not
> applying lossy compression?
I wouldn't save it as PNG, especially if you have a larger contact photo
the image
size will much bigger.
e.g. a 720x720px image has about 80kB as JPEG and 400kB as PNG
> In any case I'd recommend you add a unit test that shows that setting
> raw data
> allows retrieval of image data and that saving one picture with raw
> data and
>one picture with image data results in the same vcard output (of course
> assuming that the raw data has been created from the image and uses
> the same
> encoding format).
I'll try to write some tomorrow.
Cheers
Sebastian
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list