GNU bug report logs -
#39735
27.0.60; bugs about XBM images
Previous Next
Reported by: ynyaaa <at> gmail.com
Date: Sat, 22 Feb 2020 14:10:02 UTC
Severity: normal
Found in version 27.0.60
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
ynyaaa <at> gmail.com writes:
> (1)XBM image with :file property can not be scaled with :width or :height.
>
> (let ((f (locate-file "gnus/preview.xbm" image-load-path)))
> (image-size (create-image f 'xbm nil :width 128)))
> error-> Invalid image specification
>
> (2)XBM image with :data property has no way to scale with different
> aspect ratio.
>
> :width and :height image properties are interpreted as adittional
> properties on :data property.
I think these are probably somewhat connected: :width and :height have a
special meaning for some XBM images:
If the specification is for a bitmap loaded from memory it must
contain `:width WIDTH', `:height HEIGHT', and `:data DATA', where
WIDTH and HEIGHT are integers > 0. DATA may be:
So the Emacs XBM functions uses :width and :height so specify the
dimensions of the data, not how big the image is going to turn out to be
displayed. It's unfortunate that we're using the same properties for
two different things.
I'm not sure how to fix that. XBM images aren't used much, I would
imagine...
Eli, would it make sense to do a backwards-incompatible change here and
rename the XBM parameters to :xbm-width and :xbm-height?
> (3)XBM :data string can not be used as raw bit pattern
> if it looks like contents of XBM file,
>
> (let ((data "\
> #define b_width 1
> #define b_height 1
> static char b[] = {0x01}
> "))
> (image-size
> (create-image data 'xbm t :width 8 :height (length data))))
> error-> Invalid image specification
This is more of the same: It's the overloading of :width/:height, which
means that we don't allow those parameters for data like that:
DATA may be:
1. a string large enough to hold the bitmap data, i.e. it must
have a size >= (WIDTH + 7) / 8 * HEIGHT
2. a bool-vector of size >= WIDTH * HEIGHT
3. a vector of strings or bool-vectors, one for each line of the
bitmap.
4. a string containing an in-memory XBM file. WIDTH and HEIGHT
may not be specified in this case because they are defined in the
XBM file.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 4 years and 354 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.