[KPhotoAlbum] [Bug 145309] make "show this image" load all images in current view

Robert L Krawitz rlk at alum.mit.edu
Thu May 24 13:37:17 CEST 2007

   Date: Thu, 24 May 2007 12:26:44 +0200
   From: =?ISO-8859-1?Q?Jan_Kundr=E1t?= <jkt at gentoo.org>

   Robert L Krawitz wrote:
   > One problem I've seen with this: if I'm on a cold system, with all of
   > my images in the thumbnail view (~20000 images), when I double click
   > on one image it takes a few minutes until the image pops up.  On a
   > warm system, it's fast, suggesting that it's stat'ing every image (I
   > haven't looked at the code).  This bottleneck needs to be eliminated.

   Well, I've straced it:

   * When the application starts, there's one access(path, R_OK) and
   two lstat64() for each file in the DB (or probably rather for each
   file under your image root) -- maybe because I have the "check for
   new images on startup" enabled. Do you use this as well?

No (and in any case I have a patch that solves this, and I have a bug
open against it with the patch attached).

   * When the thumbnails are about to be shown, it calls access(path,
   F_OK) for each file in the DB that is in current viewport

That's only about 100 image, and that's not the major problem.

   * When there's one image selected and you choose "view", it calls
   access(F_OK) for each image file in current view

*THAT* is the problem.

   So, in short, although my patch indeed queries the FS for
   availability of each file in current view, this information should
   be already available in the VFS cache since the program startup.

No, because I don't use scan images on startup, and in any case that
problem's fixed.

   The only reason why it is slow for you that I can imagine is that
   your filesystem doesn't cache results of access(path, R_OK) for
   access(path, F_OK). What filesystem do you use for your images?

Like I said, this was on a *cold* system, with nothing cached.  Also,
people using network filesystems won't get caching.

   > 1) Viewing a RAW image (a .crw, to be precise) does not rotate the
   >    image if it was taken in vertical orientation (it previously did,
   >    as of about a month ago).

   Could you try to track down what SVN commit broke that?

I'll try, but I won't have a huge amount of time for this.

   > 2) The selection in the thumbnail view isn't highlighted -- there's
   >    nothing indicating which images are selected or not.  The
   >    background's a uniform black, and the images don't get the
   >    "dithered" look.

   I guess you have both "show label" and "show category" disabled. The
   attached patch puts back the pattern over highlighted image when we show
   neither categories nor labels, the aspect ratio is not 1:1 and cell
   spacing is less than 3px.

I'll try that.

   cd /local/pub && more beer > /dev/mouth

   Content-Type: text/plain;
   Content-Transfer-Encoding: quoted-printable
   Content-Disposition: inline;

   Index: ThumbnailView/ThumbnailWidget.cpp
   --- ThumbnailView/ThumbnailWidget.cpp	(revision 667590)
   +++ ThumbnailView/ThumbnailWidget.cpp	(working copy)
   @@ -106,6 +106,12 @@
		QRect rect =3D iconGeometry( row, col );
		Q_ASSERT( !rect.isNull() );
		painter->drawPixmap( rect, *pix );
   +            if ( !Settings::SettingsData::instance()->displayCategories(=
   ) &&
   +                 !Settings::SettingsData::instance()->displayLabels() &&=

   +                 ( Settings::SettingsData::instance()->thumbnailAspectRa=
   tio() !=3D Settings::Aspect_1_1 ) &&
   +                 ( Settings::SettingsData::instance()->thumbnailSpace() =
   < 3 ) &&
   +                 _selectedFiles.contains( fileName ) )
   +                painter->fillRect( rect, QBrush( palette().active().high=
   light(), Dense6Pattern ) );
		rect =3D QRect( 0, 0, cellWidth(), cellHeight() );
		if ( _leftDrop =3D=3D fileName )


   Content-Type: application/pgp-signature; name="signature.asc"
   Content-Description: OpenPGP digital signature
   Content-Disposition: attachment; filename="signature.asc"

   Version: GnuPG v1.4.7 (GNU/Linux)
   Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

   -----END PGP SIGNATURE-----


   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
   Content-Disposition: inline

   KPhotoAlbum mailing list
   KPhotoAlbum at kdab.net


More information about the KPhotoAlbum mailing list