[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
image-mode showing text title/description/etc
From: |
Kevin Ryde |
Subject: |
image-mode showing text title/description/etc |
Date: |
Thu, 24 May 2007 08:40:46 +1000 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.0.99 (gnu/linux) |
This is my idea to have image-mode display text from an image.
The motivation is that showing an image title is clearly a good thing,
and then showing author, long description, and copyright info are all
pretty useful. But I'm not inclined to go into great detail about image
characteristics, there's tools for doing that already, just stick to the
text bits.
The crunching is in lisp (at least initially) because it's more flexible
than working up an interface to the various C libraries and then
worrying what they can or can't give (libpng 1.2 for instance doesn't
have iTXt enabled by default). Oh and lisp of course can't have any
security problems, for those who worry about the doubtful record of some
of the libraries on that.
The zlib decompression is a nasty hack via gzip, but zlib.c below is an
idea for a primitive. It works, but perhaps I've made some horrible
mistake through ignorance.
I also used a bindat null terminated string parse (ie. go up to the next
\0 however far that is). It'd be a nice feature for bindat to have
builtin, but I couldn't think of a good name, or a good flag for the
existing strz (which is nulterm but only in a fixed length field).
2007-05-24 Kevin Ryde <address@hidden>
* image-mode.el: Display text comments in image files. Let the mode
work on a tty so text can be seen there too. Don't hide the cursor,
need it on the text. Don't truncate-lines, prefer to wrap the text.
Diff and whole file, whichever is easier to review:
image-mode.el.diff
Description: Text Data
image-mode.el
Description: application/emacs-lisp
zlib.c
Description: Text Data
- image-mode showing text title/description/etc,
Kevin Ryde <=