[Kde-imaging] Problems with "HTML Export" plugin

Aurelien Gateau aurelien.gateau at free.fr
Fri Apr 27 18:11:43 CEST 2007


On Fri, 27 Apr 2007 07:46:53 -0400, "Colin McMillen" <mcmillen at cs.cmu.edu> wrote:
> On 4/27/07, Stéphane Pontier <shadow.w at gmail.com> wrote:
>> On 4/27/07, Colin McMillen <mcmillen at cs.cmu.edu> wrote:
>> > The rotation looks to be a bit more involved, but I can probably
>> > figure that out if I have a spare weekend :)
>>
>> For the rotation, you can take a look at the gpssync/kmlexport.cpp
>> around line 169 and use this code in htmlexport/generator.cpp around
>> line 232  (as I used the html export as exemple to build the
>> kmlexport).
>> The only problem is that it use info.angle() that is returned by the
>> host application and then can give strange result (good rotation in
>> digikam but bad one in gwenview).
> 
> Thanks to you and Angelo!  With your help, I was able to get
> kipi-plugins built and create my first patch. :)  Here is a patch that
> rotates the images properly:
> 
> Index: kipi-plugins/htmlexport/generator.cpp
> ===================================================================
> --- kipi-plugins/htmlexport/generator.cpp       (revision 658371)
> +++ kipi-plugins/htmlexport/generator.cpp       (working copy)
> @@ -232,6 +232,11 @@
>                 // Process images
>                 if (!mInfo->useOriginalImage() && mInfo->fullResize()) {
>                         int size = mInfo->fullSize();
> +                       if (info.angle() != 0) {
> +                               QWMatrix matrix;
> +                               matrix.rotate(info.angle());
> +                               image = image.xForm(matrix);
> +                       }
>                         image = image.smoothScale(size, size,
> QImage::ScaleMin);
>                 }

Looks good, only thing I would change is to do the rotation after scaling. This
should be a bit more efficient (less pixel to move).

Aurélien




More information about the Kde-imaging mailing list