File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed
Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -328,20 +328,6 @@ If TARGET-BUFFER is non-nil, map the request ID to that buffer for error handlin
328328 ((file-exists-p path-no-ext) path-no-ext)
329329 (t nil ))))))
330330
331- (defun signel--guess-image-type (file )
332- " Read the first few bytes of FILE to determine image type (png, webp, gif)."
333- (with-temp-buffer
334- (set-buffer-multibyte nil )
335- (insert-file-contents-literally file nil 0 12 )
336- (goto-char (point-min ))
337- (cond
338- ((looking-at " \x 89PNG" ) 'png )
339- ((looking-at " GIF8" ) 'gif )
340- ((and (looking-at " RIFF" )
341- (ignore-errors (forward-char 8 ) (looking-at " WEBP" )))
342- 'webp )
343- (t nil ))))
344-
345331(defun signel--convert-apng-to-gif (file )
346332 " Convert APNG FILE to a temporary GIF using ImageMagick `convert' .
347333Returns the path to the temporary GIF. Uses `unwind-protect' to ensure cleanup."
@@ -375,7 +361,7 @@ Returns the path to the temporary GIF. Uses `unwind-protect' to ensure cleanup.
375361 (insert " \n " )
376362 (cond
377363 ((and file (file-exists-p file))
378- (let* ((type (signel--guess-image-type file))
364+ (let* ((type (image-type-from-file-header file))
379365 (final-file file)
380366 (final-type type)
381367 (converted nil ))
You can’t perform that action at this time.
0 commit comments