[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

[BUG] Viewing large images



I seem to have hit a dead end trying to figure out the reason for this
bug...

BASIC DESCRIPTION
=================
"Sometimes" images fail to load in an external program when running
`w3m-lnum-view-image' (bound to `I' or the combination `L I').


ENVIRONMENT
===========
Emacs 25.2 nox in debian


SUSPICIONS AND FINDINGS
=======================

1] It seems to be an issue loosely related to the size of the image.

2] I suspect the issue is related to something not waiting for an
   asynchronous operation to complete.

3] When this bug happens, a file named `fd:6' is created in my ~/.w3m
   directory. When the file is renamed to `foo.jpg', it is revealed to
   be a legitimate image file, and can be opened in a viewer.

   3.1] The filename seems to be a reference to a 'file descriptor',
        maybe because at the time of the completion of the download,
        the w3m temporary file name had been lost or unset.

   3.2] Sometimes, while testing, these `fd' files will accumulate with
        varying numbers.

4] Function `w3m-external-view-file' includes a feature to delete a
   downloaded file. When that is disabled and the bug is then tested, a
   file with an image name is created ~/.w3m, however it is not a
   legitimate image file, and is much smaller than the `fd:6' file.

   4.1] To do this in the latest version of w3m.el, replace line 7439:
        "(delete-file file))" with "t);(delete-file file))".

EXAMPLES
========
Compare the results of the main image links at following urls

1] https://www.rt.com/business/419631-deripaska-rusal-en-quits-president
2] https://www.rt.com/uk/419635-russia-navy-defense-spending
3] https://www.rt.com/news/419634-spacex-broadband-starlight-satellite

For me:

Url #1 produces a very large `fd:6' "image" of 658k, which NEVER
displays using the w3m command.

Url #2 produces an 'fd:6' image file of 153K and a w3meXXXXX.jpg
temporary file of 29k. SOMETIMES this displays using the w3m command.

URL #3 ALWAYS displays using the w3m command. It produces only a single
57k file in ~/.w3m, in the form w3meXXXXX.jpg

CAVEATS
=======
Since this may be a timing issue, your internet speed may affect your
ability to reproduce the bug with the listed urls. If you can't, try to
find some huge image file, and test with that.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0