[gthumb-list] Writing an extension - how to overlay metadata on images?



Hi gThumb list,

I've been playing with facial recognition for a while, and wanted a nice viewer to display results of various algorithms, so I decided to extend gThumb with a plug-in that could overlay facial markers on displayed images. I chose gThumb as it was available on my Debian 9 distro, has a suitable plug-in architecture and didn't look horrifically complex to get into...

It has been somewhat slow without any internal documentation, but I have a working prototype :)

https://github.com/phlash/gthumb-faces

Right now this does two things:

- Extends the file tree with a 'Faces' virtual folder to group images containing a face:
  I'm happy with this, although it took a lot of code (~330 lines) to write a file source.

- Overlays facial metadata (rectangle & label) on images:
  I'm not happy with this, it works by hooking itself into the file loaders for JPG/PNG
  and drawing on the pixmap as it goes past. This means the overlaid drawing gets scaled
  with the image (unreadable text or disappearing lines ensue), and I do more work than
  required as the pre-loader goes about it's business.

My question for the list:

How /should/ I go about overlaying metadata on loaded images? Where and how should I intercept the rendering process (it feels like there should be hooks registered but I cannot find any)?

Many thanks,
Phil.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]