ANN: ThumbnailCtrl For wxPython ;-)

Hello Henning,

I suggest to make the thumbnail *creation* an optional task (if it isn't
already);

      in ThumbnailCtrl, as it is at the moment, there is *no* saving of
thumbnails on disk. ThumbnailCtrl will scan the directory you selected to
find images, create thumbnails on the flight (without saving them on disk)
and display it to the ScrolledWindow.

e.g. my image database, more a catalog for archive CDs, keeps
descriptions in a MySQL table, thumbnails on disk in the same directory
structure like the originals on CD. If I'd write an interface for that
using ThumbnailCtrl I'd rather use my existing thumbnails than create
new ones.

Do you mean taking thumbnails from hard disk?

Andrea.

···

_______________________________________________
Andrea Gavana
Reservoir Engineer
MOGI ? Reservoir Characterization and Modeling Dept.
ENI S.p.A. ? Exploration & Production Division
Via Emilia, 1 ? 20097 San Donato Milanese (MI) ? Italy
Phone: +39 02 520 62972
Fax: +39 02 520 61824
E-mail: andrea.gavana@agip.it
Restyled Internet Site: http://xoomer.virgilio.it/infinity77/
____________________________________________________

Eni S.p.A.
Sede legale in Roma,
Piazzale Enrico Mattei 1, 00144 Roma
Tel. centralino: +39 06598.21
www.eni.it
Capitale sociale € 4.002.934.326 i.v.
Registro Imprese di Roma,
Codice Fiscale 00484960588
Part. IVA 00905811006
R.E.A. Roma n. 756453

This shouldn't be built in to the control, it should be part of an image
viewing app, or part of a library, distributed with thumbnail control, for
building such apps.

I have an approach to thinking about developing software that I think can be
very helpful.

Don't determine a feature set for your app, then design the app from that.

Rather, determine a set of features that apps like the one you have in mind
(in this case an image viewer, manipulator) might need, and then design (and
build) a library for building such apps. Then use that library to build your
app.

What difference would that make? It's about mind set. You are much less likely
to couple things that don't need to be coupled if you are designing a library
than an application.

Let's look at this example: You need an image viewer to view thumbnails of a
collection of images on your disk. So you write a control that scans the
disk, creates thumbnails, and draws them on the screen. All is well and good,
but now you find someone that wants to use your control, but they have the
images on on a cd, and the thumbnails somewhere else: oops, that won't work!

If you had set out with the "image and thumbnail viewing library" mind set,
perhaps you would have identified the following needs:

A way to scan the file system for images
A way to create and store thumbnails
A way to display and manipulate thumbnails
etc...

Now you write those pieces: A control to display the thumbnails that takes
some data structure or class that provides the thumbnails themselves: a
thumnail-holding-class

A function (method, whatever) to scan the disk for images.

A function (method, whatever) to create a your thumbnail-holding-class.

Put them together and you have your little app, but now someone else can write
a new version of the code that creates the thumbnail-holding-class, and they
have their app that works with images in a database, or whatever. Viola:
re-usable code!

-Just my thoughts,

-Chris

···

On Thursday 15 December 2005 1:40 am, andrea.gavana@agip.it wrote:

ThumbnailCtrl will scan the directory you selected to
find images, create thumbnails on the flight (without saving them on disk)
and display it to the ScrolledWindow.

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

some feedback, unsure why but....

run thumbs.py whilst in a network folder on my file server with jpegs,

ie python /home/richard/thumbs.py
recieved an error message which from memory went something like xlib...error
with asyncronous something or other at [hex address].

Mmm.. I though, must cut and past and send that back, but first I'll try a
local directory with boring jpegs.

ran on the local machine and it totally blew away my box - everything locked
up excecpt the terminal I started the process in - your program still
responded to key presses on the keyboard however I had to push the on/off
button to reboot. I think the lockup occurred when I'd just clicked on the
first photo with the mouse.

Not much help I guess, but that's what happened and I'm not game to try it
again.

Regards

richard

···

On Saturday 17 December 2005 04:34, Christopher Barker wrote:

On Thursday 15 December 2005 1:40 am, andrea.gavana@agip.it wrote:
> ThumbnailCtrl will scan the directory you selected to
> find images, create thumbnails on the flight (without saving them on
> disk) and display it to the ScrolledWindow.

This shouldn't be built in to the control, it should be part of an image
viewing app, or part of a library, distributed with thumbnail control, for
building such apps.

I have an approach to thinking about developing software that I think can
be very helpful.

Don't determine a feature set for your app, then design the app from that.

Rather, determine a set of features that apps like the one you have in mind
(in this case an image viewer, manipulator) might need, and then design
(and build) a library for building such apps. Then use that library to
build your app.

What difference would that make? It's about mind set. You are much less
likely to couple things that don't need to be coupled if you are designing
a library than an application.

Let's look at this example: You need an image viewer to view thumbnails of
a collection of images on your disk. So you write a control that scans the
disk, creates thumbnails, and draws them on the screen. All is well and
good, but now you find someone that wants to use your control, but they
have the images on on a cd, and the thumbnails somewhere else: oops, that
won't work!

If you had set out with the "image and thumbnail viewing library" mind set,
perhaps you would have identified the following needs:

A way to scan the file system for images
A way to create and store thumbnails
A way to display and manipulate thumbnails
etc...

Now you write those pieces: A control to display the thumbnails that takes
some data structure or class that provides the thumbnails themselves: a
thumnail-holding-class

A function (method, whatever) to scan the disk for images.

A function (method, whatever) to create a your thumbnail-holding-class.

Put them together and you have your little app, but now someone else can
write a new version of the code that creates the thumbnail-holding-class,
and they have their app that works with images in a database, or whatever.
Viola: re-usable code!

-Just my thoughts,

-Chris

Richard Terry wrote:

some feedback, unsure why but....

run thumbs.py whilst in a network folder on my file server with jpegs,

ie python /home/richard/thumbs.py
recieved an error message which from memory went something like xlib...error with asyncronous something or other at [hex address].

This usually means that there is a GUI call in the context of a non-main thread.

Mmm.. I though, must cut and past and send that back, but first I'll try a local directory with boring jpegs.

ran on the local machine and it totally blew away my box - everything locked up excecpt the terminal I started the process in - your program still responded to key presses on the keyboard however I had to push the on/off button to reboot.

This sounds like a CaptureMouse without a matching ReleaseMouse. Perhaps the Release is not happening because of the above problem.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!