Re: extragear/graphics/digikam/libs/models

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: extragear/graphics/digikam/libs/models

Bugzilla from andi.clemens@gmx.net
Something is wrong here, this fix isn't a good solution.
When I switch into PreviewMode, the size of the thumbnail is set to the
zoomLevel of the preview image.
I guess the fix must be a little bit more complex, any idea what's wrong
exactly?

Andi

On Wednesday 17 November 2010 16:53:24 Andi Clemens wrote:

> SVN commit 1198151 by aclemens:
>
> set the lastGlobalThumbSize, otherwise it is always zero and therefore a
> wrong label is set for the dtooltiptracker as well as the slider on album
> switch.
>
> There is still some weird issue:
> Everytime you set an thumbsize (e.g. 80) and switch to another album, the
> size is always
> size +=2
> even if you use the maxsize of 256 (it becomes 258).
>
> This only happens when the slider has been moved (a new thumbsize has been
> defined), if you switch the album a second time, the size+=2 version is
> used.
>
>  M  +5 -0      imagethumbnailmodel.cpp
>
>
> --- trunk/extragear/graphics/digikam/libs/models/imagethumbnailmodel.cpp
> #1198150:1198151 @@ -227,10 +227,15 @@
>      if (role == ThumbnailRole && d->thread)
>      {
>          if (value.isNull())
> +        {
>              d->thumbSize = d->lastGlobalThumbSize;
> +        }
>          else
> +        {
>              d->thumbSize = value.toInt();
> +            d->lastGlobalThumbSize = d->thumbSize;
>      }
> +    }
>      return ImageModel::setData(index, value, role);
>  }
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: extragear/graphics/digikam/libs/models

Marcel Wiesweg

> Something is wrong here, this fix isn't a good solution.
> When I switch into PreviewMode, the size of the thumbnail is set to the
> zoomLevel of the preview image.
> I guess the fix must be a little bit more complex, any idea what's wrong
> exactly?

lastGlobalThumbnailSize is set when you call setThumbnailSize() on the model,
and it should only be set there.
In fact, it is never used: Because all views are driven by the same model, we
cannot set a common thumbnail size. Instead, each ItemViewImageDelegate has
its own thumbnail size which it sets with setData, requests the thumbnail,
then resets again.
To find out the thumbnail size of the view, call
ImageCategorizedView::thumbnailSize() which calls the delegate's
thumbnailSize().

Where is the model's global thumbnail size used? It is probably invalid.

Note that there is a border of 1px width around each thumbnail, so
ThumbnailLoadThread::maximumThumbnailSize() is 256 but
maximumThumbnailPixmapSize(true) is 258.

Marcel
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel