(otherwise value)))
(defun exif--read-chunk (bytes)
- "Return BYTES octets from the buffer and advance point that much."
+ "Return BYTES octets from the current buffer and advance point that much.
+ This function assumes that the current buffer is unibyte."
(when (> (+ (point) bytes) (point-max))
- (signal 'exif-error "Premature end of file"))
+ (signal 'exif-error '("Premature end of file")))
(prog1
(buffer-substring (point) (+ (point) bytes))
(forward-char bytes)))
(defun exif--read-number-be (bytes)
- "Read BYTES octets from the buffer as a chunk of big-endian bytes.
- Advance point to after the read bytes."
+ "Read BYTES octets from the current buffer as a chunk of big-endian bytes.
+ Advance point to after the read bytes.
+ This function assumes that the current buffer is unibyte."
(when (> (+ (point) bytes) (point-max))
- (signal 'exif-error "Premature end of file"))
+ (signal 'exif-error '("Premature end of file")))
(let ((sum 0))
(dotimes (_ bytes)
(setq sum (+ (* sum 256) (following-char)))
sum))
(defun exif--read-number-le (bytes)
- "Read BYTES octets from the buffer as a chunk of low-endian bytes.
- Advance point to after the read bytes."
+ "Read BYTES octets from the current buffer as a chunk of little-endian bytes.
+ Advance point to after the read bytes.
+ This function assumes that the current buffer is unibyte."
(when (> (+ (point) bytes) (point-max))
- (signal 'exif-error "Premature end of file"))
+ (signal 'exif-error '("Premature end of file")))
(let ((sum 0))
(dotimes (i bytes)
(setq sum (+ (* (following-char) (expt 256 i)) sum))