Function: exif--direct-ascii-value

exif--direct-ascii-value is a byte-compiled function defined in exif.el.gz.

Signature

(exif--direct-ascii-value VALUE NBYTES LE)

Documentation

Make a string representing VALUE with NBYTES bytes according to LE endianness.

VALUE is an integer value of NBYTES bytes. The return value is a null-terminated unibyte string whose length is NBYTES+1 bytes. If LE is non-nil, the returned string representation of VALUE is little-endian, otherwise it is big-endian.

Source Code

;; Defined in /usr/src/emacs/lisp/image/exif.el.gz
(defun exif--direct-ascii-value (value nbytes le)
  "Make a string representing VALUE with NBYTES bytes according to LE endianness.
VALUE is an integer value of NBYTES bytes.
The return value is a null-terminated unibyte string whose length is
NBYTES+1 bytes.  If LE is non-nil, the returned string representation of
VALUE is little-endian, otherwise it is big-endian."
  (with-temp-buffer
    (set-buffer-multibyte nil)
    (if le
        (dotimes (i nbytes)
          (insert (logand (ash value (* i -8)) 255)))
      (dotimes (i nbytes)
        (insert (logand (ash value (* (- (1- nbytes) i) -8)) 255))))
    (insert 0)
    (buffer-string)))